From 2dd3066bbf9eab2abcf846ea63f3928bc7f842a5 Mon Sep 17 00:00:00 2001 From: carlosg Date: Thu, 27 Sep 2007 22:37:47 +0000 Subject: 2007-09-28 Carlos Garnacho * Utils/Backend.pm (print_platform_list): Added, prints supported platforms. (init): parse --platform-list * diagnostics.pl: put that in the help blurb. --- Utils/Backend.pm | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'Utils') diff --git a/Utils/Backend.pm b/Utils/Backend.pm index e3c19c5..100c3ac 100644 --- a/Utils/Backend.pm +++ b/Utils/Backend.pm @@ -61,6 +61,8 @@ sub print_usage --disable-shutdown Disable default shutdown timeout of 180 seconds. + --list-platforms List available platforms. + end_of_usage_text; print STDERR $usage_text; @@ -68,6 +70,21 @@ end_of_usage_text; exit $exit_code if $exit_code ne undef; } +sub print_platform_list +{ + my ($platforms) = &Utils::Platform::get_platform_info (); + + foreach $platform (keys %$platforms) + { + my $value = $$platforms{$platform}; + my $desc = join (" ", @$value); + + printf ("%s\t- %s\n", $platform, $desc); + } + + exit 0; +} + # --- Initialization and finalization --- # sub set_with_param @@ -132,6 +149,7 @@ sub init elsif ($arg eq "--platform") { &set_dist (\%tool, shift @args); } elsif ($arg eq "--disable-shutdown") { &set_disable_shutdown (\%tool); } elsif ($arg eq "--verbose" || $arg eq "-v") { &set_with_param (\%$tool, "do_verbose", 1); } + elsif ($arg eq "--list-platforms") { &print_platform_list (\%tool) } else { print STDERR "Error: Unrecognized option '$arg'.\n\n"; -- cgit v1.2.3