https://github.com/szaghi/FLAP
Revision 0e0c19a9897c3f064f8f2f80d95f0acd019e943e authored by Stefano Zaghi on 12 July 2019, 15:17:55 UTC, committed by Stefano Zaghi on 12 July 2019, 15:17:55 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 ```
Tip revision: 0e0c19a9897c3f064f8f2f80d95f0acd019e943e authored by Stefano Zaghi on 12 July 2019, 15:17:55 UTC
Merge tag 'v1.2.0' into develop
Merge tag 'v1.2.0' into develop
Tip revision: 0e0c19a
File | Mode | Size |
---|---|---|
CMake | ||
doc | ||
scripts | ||
src | ||
.gitignore | -rw-r--r-- | 298 bytes |
.gitmodules | -rw-r--r-- | 397 bytes |
.travis.yml | -rw-r--r-- | 1.6 KB |
CMakeLists.txt | -rw-r--r-- | 8.4 KB |
CONTRIBUTING.md | -rw-r--r-- | 3.6 KB |
LICENSE.bsd-2.md | -rw-r--r-- | 1.5 KB |
LICENSE.bsd-3.md | -rw-r--r-- | 1.5 KB |
LICENSE.gpl3.md | -rw-r--r-- | 34.4 KB |
LICENSE.mit.md | -rw-r--r-- | 1.1 KB |
README.md | -rw-r--r-- | 18.9 KB |
codecov.yml | -rw-r--r-- | 43 bytes |
fobos | -rw-r--r-- | 6.0 KB |
makefile | -rw-r--r-- | 5.5 KB |
Computing file changes ...