Video Screencast Help

VCS Bash completion - Bash Completion for VCS CLI

Created: 18 Feb 2010 • Updated: 22 Feb 2012 | 3 comments
Swapnil_Patankar's picture
+2 2 Votes
Login to vote
BETA: VCS Bash Completion - Bash Completion for VCS CLI

Please Note:  This is an early beta and comes WITHOUT ANY WARRANTY.  This should not be installed on production machines.

This is an early beta of adding bash completion to VCS HA commands.
We would like to get feedback from the user community about this utility.

Adding bash completion support for ha commands makes them more user friendly.
The examples below show how bash completion for ha commands would work:
1. hagrp -of[TAB] would complete to hagrp -offline
2. hagrp -offline -f[TAB] would complete to hagrp -offline -force
3. But hagrp -fo[TAB] will not complete (since there is no hagrp -force major option)
4. hagrp -offline -force gr[TAB] would list all the groups starting from gr, allowing the user to identify & select the correct one.

At every stage [TAB] completion would show the user a list of valid inputs at that context.
Thus the user no longer has to remember the exact command line syntax or even the object names.
As long as the user follows [TAB] completion, he would get the correct command line.

hasync utility:
To auto complete object & attribute names, we will pre-fetch these and store in metadata files within the user's home directory.
We have provided a hasync utility for this.
Whenever the config changes, the user can fire hasync to get the updated metadata from had. Or hasync can be added to cron for periodic refresh.

Support for other commands would be added later.

This has been tested using VCS 5.1 ha commands on RHEL 5.

Comments 3 CommentsJump to latest comment

Bhavin Thaker's picture

Bash Auto-completion for VCS CLI commands is a really cool feature. I believe that most customers would be interested in this kind of functionality so that even a relatively new VCS user can use the VCS commands effectively without having to lookup the man pages for options and the VCS status commands for the VCS object names.

Just hit TAB and learn the next step. It reminds me of how some folks used the AAA maps and planned out the journey when travelling and how they just use GPS now to tell them of the next step, making life simpler.

Can we get opinions from folks in the VCS community? Should this be a feature that should be targetted for the next release of VCS so that users get it by default in the product without having to download and use it?

Please comment.

Bhavin Thaker.

Login to vote
aborzenkov's picture

Being infrequent VCS CLI user myself I would definitely wlecome this addition. Actually being maintained part of VCS is prerequisite for it being useful. In my experience not up-to-date completion definitions is often worse than no completion at all.

Thank you!

Login to vote