summaryrefslogtreecommitdiff
path: root/Utils
diff options
context:
space:
mode:
authorcarlosg <carlosg>2007-09-27 22:37:47 +0000
committercarlosg <carlosg>2007-09-27 22:37:47 +0000
commit2dd3066bbf9eab2abcf846ea63f3928bc7f842a5 (patch)
treed7445a7cd36e4a8b465d2aceefa81e756a65fb93 /Utils
parent15bad8e4355062a8f9ff3fc99830ffe5c3c50ea8 (diff)
2007-09-28 Carlos Garnacho <carlosg@gnome.org>
* Utils/Backend.pm (print_platform_list): Added, prints supported platforms. (init): parse --platform-list * diagnostics.pl: put that in the help blurb.
Diffstat (limited to 'Utils')
-rw-r--r--Utils/Backend.pm18
1 files changed, 18 insertions, 0 deletions
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";