Tags: szaghi/FLAP
Tags
Add ignore passed unknown CLAs, fix issue#82 The CLI can now be initialized with a flag for ignoring the passed CLAs that are unknown. An error is still echoed, but the CLI parsing goes on until the end without exit the flow. By default a passed unknown CLA raises a blocking error as in the previous verions. This change addresses the need by: add a new option to `init` method of CLI object, e.g. call cli%init(..., ignore_unknown_clas=.true.) A dedicated test has been added, i.e. `src/test/flap_test_ignore_unknown_clas.f90` Side effects: Nothing. Fully backward compatible.
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 ```
PreviousNext