Merge: Tired of having to remember all the Nit options? Try bash_completion!
authorJean Privat <jean@pryen.org>
Wed, 23 Jul 2014 20:33:16 +0000 (16:33 -0400)
committerJean Privat <jean@pryen.org>
Wed, 23 Jul 2014 20:33:16 +0000 (16:33 -0400)
commit9a5f7e8a9fc5d8e4b34c61c86ec8798ff284588e
tree8368c7f0c4dc03d39234dc331e0b1a8a19aff6cd
parent7bff6ba52f90f20f635ae36305fae7e4b77c7c49
parent881bbfd527f00b5e2e8a40c38732159eca5b0fae
Merge: Tired of having to remember all the Nit options? Try bash_completion!

This PR enables the option --gen-bash-completion that allow user to generate a bash completion file.

Exemple with `nitdoc`:

    $ nitdoc --gen-bash-completion
    $ sudo ln -s <nitdir>/bin/nitdoc.bash /etc/bash_completion.d/nitdoc
    $ . /etc/bash_completion.d/nitdoc

Then:

    $ nitdoc [TAB][TAB]
    $ file1.nit    file2.nit    file3.nit

    $ nitdoc --[TAB][TAB]
    --bash-toolname         --github-base-sha1      --no-dot                --sharedir
    --custom-brand          --github-gitdir         --only-metamodel        --shareurl
    --custom-footer-text    --github-upstream       --only-parse            --source
    --custom-overview-text  --help                  --path                  --stop-on-first-error
    --custom-title          --ignore-visibility     --piwik-site-id         --verbose
    --dir                   --log                   --piwik-tracker         --version
    --disable-phase         --log-dir               --private               --warn
    --gen-bash-completion   --no-color              --quiet

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

Pull-Request: #575
Reviewed-by: Jean Privat <jean@pryen.org>
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>
Reviewed-by: Alexis Laferrière <alexis.laf@xymus.net>