aboutsummaryrefslogtreecommitdiff
path: root/completion
diff options
context:
space:
mode:
authorAyush Agarwal <ayush@fastmail.in>2021-09-21 00:39:17 +0530
committerAyush Agarwal <ayush@fastmail.in>2021-09-21 00:39:17 +0530
commita45d1a2f4ce4cdecd581feabba32e010b6427c3f (patch)
tree40d7a1deffb8bdc76db6355046891c423001b5dc /completion
parent81e2c3b92a99f4c5cc663592b75293f8efeedae5 (diff)
added bash completion
Diffstat (limited to 'completion')
-rw-r--r--completion/tessen.bash-completion31
1 files changed, 31 insertions, 0 deletions
diff --git a/completion/tessen.bash-completion b/completion/tessen.bash-completion
new file mode 100644
index 0000000..8134417
--- /dev/null
+++ b/completion/tessen.bash-completion
@@ -0,0 +1,31 @@
+_tessen() {
+ local cur prev
+ COMPREPLY=()
+ cur="${COMP_WORDS[COMP_CWORD]}"
+ prev="${COMP_WORDS[COMP_CWORD - 1]}"
+ all_long_opts="--backend --action --help --version "
+ all_short_opts="-b -a -h -v "
+ case "$prev" in
+ --backend | -b | --action | -a)
+ mapfile -t COMPREPLY < <(compgen -o bashdefault -o default -- "${cur}")
+ return 0
+ ;;
+ *)
+ case "$cur" in
+ --*)
+ mapfile -t COMPREPLY < <(compgen -W "${all_long_opts}" -- "${cur}")
+ return 0
+ ;;
+ -*)
+ mapfile -t COMPREPLY < <(compgen -W "${all_short_opts}" -- "${cur}")
+ return 0
+ ;;
+ *)
+ mapfile -t COMPREPLY < <(compgen -o bashdefault -o default -- "${cur}")
+ return 0
+ ;;
+ esac
+ ;;
+ esac
+}
+complete -F _tessen tessen