Added '--list', '-L'

Added option to list available cluster tags (idea from Markus Manzke)
This commit is contained in:
Duncan Ferguson 2010-09-09 21:22:53 +01:00
parent e2cc9a0863
commit 2aa655b38d
3 changed files with 16 additions and 0 deletions

View file

@ -87,6 +87,7 @@ my @options_spec = (
'title|T=s',
'output-config|u',
'font|f=s',
'list|L',
);
my %options;
my %config;
@ -414,6 +415,12 @@ sub dump_config {
exit_prog if ( !$noexit );
}
sub list_tags {
print('Available cluster tags:',$/);
print "\t", $_, $/ foreach (sort(keys(%clusters)));
exit_prog;
}
sub check_ssh_hostnames {
return unless ( $config{method} eq "ssh" );
@ -2152,6 +2159,8 @@ sub run {
get_clusters();
list_tags() if ( $options{'list'} );
if (@ARGV) {
@servers = resolve_names(@ARGV);
}
@ -2259,6 +2268,8 @@ the code until this time.
=item dump_config
=item list_tags
=item evaluate_commands
=item exit_prog