From 13c42357305bb008328490c178d316ba527dbf4a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakob=20Sch=C3=B6ttl?= Date: Sat, 12 Jan 2019 19:59:04 +0100 Subject: [PATCH] Leave out subcommands with only one letter --- shell-completion/output-commands.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/shell-completion/output-commands.sh b/shell-completion/output-commands.sh index 44135a380..ef95d21df 100755 --- a/shell-completion/output-commands.sh +++ b/shell-completion/output-commands.sh @@ -9,7 +9,11 @@ main() { cat > "$tmp" sed -rn 's/^ ([-a-z]+).*/\1/gp' "$tmp" - sed -rn 's/^ .*\(([a-z]+)\).*/\1/gp' "$tmp" + + # Do not output single letter commands, it's not useful. + sed -rn 's/^ .*\(([a-z]+)\).*/\1/gp' "$tmp" \ + | grep -v ^.$ + # TODO missing: (reg, r) (multiple aliases) }