Skip to content

Instantly share code, notes, and snippets.

@davesque
Last active August 29, 2015 14:05
Show Gist options
  • Save davesque/205df31dd64933c89f0b to your computer and use it in GitHub Desktop.
Save davesque/205df31dd64933c89f0b to your computer and use it in GitHub Desktop.
_s() {
COMPREPLY=()
cur="${COMP_WORDS[COMP_CWORD]}"
if [[ $COMP_CWORD -eq 1 ]]; then
opts=($S_BIN_PATH/*)
basenames="${opts[@]##*/}"
COMPREPLY=( $(compgen -W "${basenames[@]}" -- $cur) )
fi
}
complete -F _s s
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment