]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
Accept new option: --program-name=NAME, so that we
authorJim Meyering <jim@meyering.net>
Tue, 20 Apr 2004 10:03:53 +0000 (10:03 +0000)
committerJim Meyering <jim@meyering.net>
Tue, 20 Apr 2004 10:03:53 +0000 (10:03 +0000)
can override the one in --version output.  This is needed solely
so that test.1 doesn't refer to `[' as the program name.
Reported by Benjamin Cutler as http://bugs.debian.org/205251.

man/help2man

index 2507a791389fa5c300a24d53b870bbf5e92b4cb4..21109e80466bffa2a312151fff852d11a3985c71 100755 (executable)
@@ -78,6 +78,8 @@ my $help_info = sprintf _(<<'EOT'), $this_program, $this_program;
 
 Usage: %s [OPTION]... EXECUTABLE
 
+     --program_name=STRING  override any name found in output of
+                              `EXECUTABLE --version'
  -n, --name=STRING       description for the NAME paragraph
  -s, --section=SECTION   section number for manual page (1, 6, 8)
  -m, --manual=TEXT       name of manual (User Commands, ...)
@@ -107,8 +109,10 @@ my $locale = 'C';
 my $help_option = '--help';
 my $version_option = '--version';
 my ($opt_name, @opt_include, $opt_output, $opt_info, $opt_no_info);
+my $opt_program_name;
 
 my %opt_def = (
+    'program-name=s'    => \$opt_program_name,
     'n|name=s'          => \$opt_name,
     's|section=s'       => \$section,
     'm|manual=s'        => \$manual,
@@ -279,6 +283,8 @@ else
 }
 
 $program =~ s!.*/!!;
+$opt_program_name
+  and $program = $opt_program_name;
 
 # No info for `info' itself.
 $opt_no_info = 1 if $program eq 'info';