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

@ -1,5 +1,6 @@
????-??-?? Duncan Ferguson <duncan_ferguson@user.sf.net> - v4.00_06
* Fix test error on 5.8.8 (reported by Wei Wang)
* Added '--list', '-L' to list available cluster tags (idea from Markus Manzke)
2010-06-20 Duncan Ferguson <duncan_ferguson@user.sf.net> - v4.00_05

View file

@ -164,6 +164,10 @@ Specify the font to use in the terminal windows. Use standard X font notation.
Show basic help text, and exit
=item --list, -L
List available cluster tags.
=item --man,-H
Show full help test (the man page), and exit

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