https://github.com/szaghi/FLAP
Release v1.2.0 created by Stefano Zaghi on 12 July 2019, 15:17:32 UTC
Add bash completition script output issue#86
Add bash completition script output: given a CLI now it is possibile to save a *bash auto completition script* that once *sourced* in a bash shell provides the auto completition capabilities. Note tha for CLI with multiple CLAs groups (like the `git` command) the generated script is smart enough to distinguish the CLAs of each group, e.g. the added test with 2 CLAs groups generates the following script: ```bash _completion() { cur=${COMP_WORDS[COMP_CWORD]} prev=${COMP_WORDS[COMP_CWORD - 1]} if [ "$prev" == "compile" ] ; then COMPREPLY=( $( compgen -W " --compiler -c --flags -f --help -h --version -v" -- $cur ) ) elif [ "$prev" == "clean" ] ; then COMPREPLY=( $( compgen -W " --clean -c --clean-all -ca --help -h --version -v" -- $cur ) ) else COMPREPLY=( $( compgen -W " --help -h --version -v compile clean" -- $cur ) ) fi return 0 } complete -F _completion flap_test_save_bash_completition ```
Target: 9784ea0b3a891fcb69bfa216b1b7a043930b24e7
Directory: f9c9556ffa3972b5865f08a0c7e72c129e15f861
back to top