Mutexed: (space separated list of options this overrides)
Requires: (space separated list of features this option requires)
See-also: (space separated list of related options)
+ Redirect: (option name to use instead)
Help: (short text for the --help output for this option)
--- (end of meta-data)
my %optlong;
my %helplong;
my %arglong;
+my %redirlong;
# get the long name version, return the man page string
sub manpageify {
my $arg;
my $mutexed;
my $requires;
+ my $redirect;
my $seealso;
my $magic; # cmdline special option
while(<F>) {
elsif(/^Requires: (.*)/i) {
$requires=$1;
}
+ elsif(/^Redirect: (.*)/i) {
+ $redirect=$1;
+ }
elsif(/^---/) {
last;
}
}
print ".IP \"$opt\"\n";
- my $o;
- if($protocols) {
- $o++;
- print "($protocols) ";
- }
- if(!$arg && !$mutexed && !$magic) {
- $o++;
- print "[Boolean] ";
+ if($redirect) {
+ my $l = manpageify($redirect);
+ print "Use $l instead!\n";
}
- if($magic) {
- $o++;
- print "[cmdline control] ";
+ else {
+ my $o;
+ if($protocols) {
+ $o++;
+ print "($protocols) ";
+ }
+ if(!$arg && !$mutexed && !$magic) {
+ $o++;
+ print "[Boolean] ";
+ }
+ if($magic) {
+ $o++;
+ print "[cmdline control] ";
+ }
+ print "\n" if($o);
}
- print "\n" if($o);
-
printdesc(@desc);
undef @desc;
$opt .= " $arg";
}
- printf " %-19s %s\n", $opt, $helplong{$f};
+ my $line = sprintf " %-19s %s\n", $opt, $helplong{$f};
+
+ if(length($line) > 79) {
+ print STDERR "WARN: the --$long line is too long\n";
+ }
+ print $line;
}
}