cedadev / cis

Home of the Community Intercomparison Suite.
www.cistools.net
GNU Lesser General Public License v3.0
46 stars 18 forks source link

Bash competion #7

Open avaldebe opened 8 years ago

avaldebe commented 8 years ago

Hi @duncanwp,

I wrote a bash completion script for cis. To use it you jost need to source it as

source cisCompletion.bash
cis [tab] ...

Hope you find this useful enough to add it to the repo.

Cheers, Álvaro.

duncanwp commented 8 years ago

Hi Alvaro - this is great thanks! I didn't even know you could do this to be honest. My only slight concern is that we have to remember to keep this up to date if we change any of the commands - it's very distinct from the parsing code.

I've also just done a little googling and found this: https://github.com/kislyuk/argcomplete. Have you come across it? It might make things a little easier to manage?

Thanks for the inspiration either way :-)

avaldebe commented 8 years ago

My only slight concern is that we have to remember to keep this up to date if we change any of the commands - it's very distinct from the parsing code.

I agree. Alas, it requires some knowledge of what the arguments do and which ones expect a file after, so it is not as straightforward as I hoped.

I've also just done a little googling and found this: https://github.com/kislyuk/argcomplete. Have you come across it? It might make things a little easier to manage?

I did not know about it. Will have a look.