Show
Ignore:
Timestamp:
09/30/09 04:29:59 (3 years ago)
Author:
H. Peter Anvin <hpa@…>
Children:
6ce3fcc997931e7903408724b4cade3ed09b1e99
Parents:
be00bea49c01c59cb6891934b13614393043c877
git-committer:
H. Peter Anvin <hpa@zytor.com> / 2009-09-29T21:29:59Z-0700
Message:

pxelinux-options: add help text

Add help text to pxelinux-options.

Signed-off-by: H. Peter Anvin <hpa@…>

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • utils/pxelinux-options

    rbe00be r1c8d53  
    1717    ); 
    1818 
    19 @fmt_oneip   = (\&parse_oneip, \&show_ip); 
    20 @fmt_multiip = (\&parse_multiip, \&show_ip); 
    21 @fmt_string  = (\&parse_string, \&show_string); 
    22 @fmt_uint32  = (\&parse_uint32, \&show_uint32); 
     19@fmt_oneip   = ("ip-address", \&parse_oneip, \&show_ip); 
     20@fmt_multiip = ("ip-address-list", \&parse_multiip, \&show_ip); 
     21@fmt_string  = ("string", \&parse_string, \&show_string); 
     22@fmt_uint32  = ("uint32", \&parse_uint32, \&show_uint32); 
    2323 
    2424%option_format = ( 
     
    162162 
    163163    if (defined($option_format{$opt})) { 
    164         $v = $option_format{$opt}[0]($arg); 
     164        $v = $option_format{$opt}[1]($arg); 
    165165        return $v if (defined($v)); 
    166166    } 
     
    175175 
    176176    if (defined($option_format{$opt})) { 
    177         $v = $option_format{$opt}[1]($arg); 
     177        $v = $option_format{$opt}[2]($arg); 
    178178        return $v if (defined($v)); 
    179179    } 
     
    328328sub usage() 
    329329{ 
    330     print STDERR "FIX USAGE MESSAGE\n"; 
     330    my $i; 
     331 
     332    print STDERR "Usage: $0 options pxelinux.0\n"; 
     333    print STDERR "Options:\n"; 
     334    print STDERR "--before option value   -b   Add an option before DHCP data\n"; 
     335    print STDERR "--after  option value   -a   Add an option after DHCP data\n"; 
     336    print STDERR "--delete option         -d   Delete an option\n"; 
     337    print STDERR "--list                  -l   List set options\n"; 
     338    print STDERR "--dry-run               -n   Don't modify the target file\n"; 
     339    print STDERR "--help                  -h   Display this help text\n"; 
     340    print STDERR "\n"; 
     341    print STDERR "The following DHCP options are currently recognized:\n"; 
     342    printf STDERR "%-23s %-3s  %s\n", 'Name', 'Num', 'Value Format'; 
     343 
     344    foreach $i (sort { $a <=> $b } keys(%option_names)) { 
     345        printf STDERR "%-23s %3d  %s\n", 
     346                $option_names{$i}, $i, $option_format{$i}[0]; 
     347    } 
    331348} 
    332349