Last active
July 23, 2020 20:24
-
-
Save craigphicks/af418e9eb57a493276da60c9e1905044 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# copyright craigphicks 2020 - free to use with due attribution | |
confirm_args(){ | |
logger -t "confirm_args" -- "#=${#}" | |
for index in `seq 0 ${#}` ; do | |
eval item=\$$index | |
logger -t "confirm_args" -- "[$index] ${item}" | |
done | |
} | |
_foo_completion(){ | |
logger -t "_foo_completion" -- "COMP_CWORD=${COMP_CWORD}" | |
logger -t "_foo_completion" -- "#COMP_WORDS=${#COMP_WORDS[@]}" | |
for index in `seq 0 $((${#COMP_WORDS[@]}-1))` ; do | |
logger -t "_foo_completion" -- "[$index] ${COMP_WORDS[$index]}" | |
done | |
} | |
declare -f _foo_completion | |
complete -F _foo_completion "foo" | |
alias foo=confirm_args |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment