diff options
author | hansp <hansp> | 2000-12-10 02:32:36 +0000 |
---|---|---|
committer | hansp <hansp> | 2000-12-10 02:32:36 +0000 |
commit | f6855e8f926068d71a472ecc508cb3d127e4c3d0 (patch) | |
tree | a824ad435482d517061341f7298f58b876e2813c /memory-conf.in | |
parent | ffb197f35af4c4042071a47347cf8bfa2261aee0 (diff) |
Removed duplicated code related to help texts in the backends.
Made the help text generic and shared between the backends.
Wrote short descriptions for the backends, inserted in the help texts.
Diffstat (limited to 'memory-conf.in')
-rwxr-xr-x | memory-conf.in | 64 |
1 files changed, 7 insertions, 57 deletions
diff --git a/memory-conf.in b/memory-conf.in index f75f8d6..b63aaa4 100755 --- a/memory-conf.in +++ b/memory-conf.in @@ -40,59 +40,15 @@ require "___scriptsdir___/be.pl"; -# --- Usage text --- # +# --- Tool information --- # -my $Usage =<<"End_of_Usage;"; -Usage: memory-conf <--get | --set | --filter | --help> - [--prefix <location>] [--disable-immediate] - [--verbose] [--progress] - - Major operations (specify one of these): - - -g --get Prints the current memory configuration to standard - output, as as standalone XML document. The parameters - are read from the host\'s low-level configuration. - - -s --set Updates the system memory configuration from a standalone - XML document read from standard input. The format is - the same as for the document generated with --get. - - -f --filter Reads XML configuration from standard input, parses it, - and writes the configurator\'s impression of it back to - standard output. Good for debugging and parsing tests. - - -h --help Prints this page to standard output. - - --version Prints version information to standard output. - - Modifiers (specify any combination of these): - - -p --prefix <location> Specifies a directory prefix where the - configuration is looked for or stored. When storing - (with --set), directories and files may be created. - - --disable-immediate With --set, prevents the configurator from - running any commands that make immediate changes to - the system configuration. Use with --prefix to make a - dry run that won\'t affect your configuration. - - With --get, suppresses running of non-vital external - programs that might take a long time to finish. - - -v --verbose Turns on diagnostic messages to standard error. - - --progress Prints progress information suitable for interactive - frontends to standard output. The progress information - is printed before any XML, and consists of a decimal - number saying how many dots to expect, followed by a - newline, and a running line of dots as the operation - progresses, followed by a newline after the last dot. - The dots generated can be more or less than the - number indicated on the first line. +$name = "memory"; +$version = "0.1.0"; -End_of_Usage; +$description =<<"end_of_description;"; + Configures main and swap memory. +end_of_description; -$version = "0.1.0"; # --- System config file locations --- # @@ -567,16 +523,10 @@ sub filter # --- Main --- # -be_init(@ARGV); +be_init($name, $version, $description, @ARGV); # Do our thing. if ($be_operation eq "get") { get; } elsif ($be_operation eq "set") { set; } elsif ($be_operation eq "filter") { filter; } -else - { - print STDERR "Error: No operation specified.\n\n"; - print STDERR $Usage; exit(1); - } - |