summaryrefslogtreecommitdiff
path: root/utils
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2009-09-29 21:29:59 -0700
committerH. Peter Anvin <hpa@zytor.com>2009-09-29 21:29:59 -0700
commit1c8d53bf85b1f570d1dc69b1498b880a3ade836a (patch)
treebc06c4da5322f7d93024b45414f87ca52c9f189f /utils
parentbe00bea49c01c59cb6891934b13614393043c877 (diff)
downloadsyslinux-1c8d53bf85b1f570d1dc69b1498b880a3ade836a.tar.gz
pxelinux-options: add help text
Add help text to pxelinux-options. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Diffstat (limited to 'utils')
-rwxr-xr-xutils/pxelinux-options31
1 files changed, 24 insertions, 7 deletions
diff --git a/utils/pxelinux-options b/utils/pxelinux-options
index 0d45f26c..ab7075b5 100755
--- a/utils/pxelinux-options
+++ b/utils/pxelinux-options
@@ -16,10 +16,10 @@ use bytes;
211 => 'reboottime'
);
-@fmt_oneip = (\&parse_oneip, \&show_ip);
-@fmt_multiip = (\&parse_multiip, \&show_ip);
-@fmt_string = (\&parse_string, \&show_string);
-@fmt_uint32 = (\&parse_uint32, \&show_uint32);
+@fmt_oneip = ("ip-address", \&parse_oneip, \&show_ip);
+@fmt_multiip = ("ip-address-list", \&parse_multiip, \&show_ip);
+@fmt_string = ("string", \&parse_string, \&show_string);
+@fmt_uint32 = ("uint32", \&parse_uint32, \&show_uint32);
%option_format = (
6 => \@fmt_multiip,
@@ -161,7 +161,7 @@ sub parse_option($$)
my $v;
if (defined($option_format{$opt})) {
- $v = $option_format{$opt}[0]($arg);
+ $v = $option_format{$opt}[1]($arg);
return $v if (defined($v));
}
@@ -174,7 +174,7 @@ sub show_option($$)
my $v;
if (defined($option_format{$opt})) {
- $v = $option_format{$opt}[1]($arg);
+ $v = $option_format{$opt}[2]($arg);
return $v if (defined($v));
}
@@ -327,7 +327,24 @@ sub list_options($$)
sub usage()
{
- print STDERR "FIX USAGE MESSAGE\n";
+ my $i;
+
+ print STDERR "Usage: $0 options pxelinux.0\n";
+ print STDERR "Options:\n";
+ print STDERR "--before option value -b Add an option before DHCP data\n";
+ print STDERR "--after option value -a Add an option after DHCP data\n";
+ print STDERR "--delete option -d Delete an option\n";
+ print STDERR "--list -l List set options\n";
+ print STDERR "--dry-run -n Don't modify the target file\n";
+ print STDERR "--help -h Display this help text\n";
+ print STDERR "\n";
+ print STDERR "The following DHCP options are currently recognized:\n";
+ printf STDERR "%-23s %-3s %s\n", 'Name', 'Num', 'Value Format';
+
+ foreach $i (sort { $a <=> $b } keys(%option_names)) {
+ printf STDERR "%-23s %3d %s\n",
+ $option_names{$i}, $i, $option_format{$i}[0];
+ }
}
%option_rnames = ();