Last active
January 29, 2018 05:13
-
-
Save Rodsevich/e8e2fc79a927e1f4b55548828192d89e to your computer and use it in GitHub Desktop.
Una forma en dart de tener bash completion
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
#Esto debería ir en /etc/bash_completion.d/<cmd> | |
# sino en >> ~/.bashrc | |
if type complete &>/dev/null; then | |
_<cmd>_completion () { | |
local cur options #declara variables solo para esta función | |
cur="${COMP_WORDS[COMP_CWORD]}" | |
options=$( <cmd> completion options $COMP_LINE ) | |
COMPREPLY=( $( compgen -W "$options" -- $cur ) ) | |
} | |
complete -F _<cmd>_completion <cmd> | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment