summaryrefslogtreecommitdiff
path: root/step-cli/bash_autocomplete
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2020-05-22 20:34:03 +0200
committerErich Eckner <git@eckner.net>2020-05-22 20:34:03 +0200
commitffed9421d7a66add26f93bcbd71ade3c1205c8a4 (patch)
treefee9409c2016ebfc109e507e485b98ebb744b4a6 /step-cli/bash_autocomplete
parent369508d4171608b10696827e295348559be97769 (diff)
downloadarchlinuxewe-ffed9421d7a66add26f93bcbd71ade3c1205c8a4.tar.xz
step-cli neu
Diffstat (limited to 'step-cli/bash_autocomplete')
-rw-r--r--step-cli/bash_autocomplete21
1 files changed, 21 insertions, 0 deletions
diff --git a/step-cli/bash_autocomplete b/step-cli/bash_autocomplete
new file mode 100644
index 000000000..d30588089
--- /dev/null
+++ b/step-cli/bash_autocomplete
@@ -0,0 +1,21 @@
+#! /bin/bash
+
+: ${PROG:=$(basename ${BASH_SOURCE})}
+
+_cli_bash_autocomplete() {
+ local cur opts base
+ COMPREPLY=()
+ cur="${COMP_WORDS[COMP_CWORD]}"
+ opts=$( ${COMP_WORDS[@]:0:$COMP_CWORD} --generate-bash-completion )
+ if [ -n "${opts}" ];
+ then
+ COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
+ else
+ _filedir
+ fi
+ return 0
+}
+
+complete -F _cli_bash_autocomplete $PROG
+
+unset PROG