Lines Matching +full:no +full:- +full:useless +full:- +full:escape
1 #!/usr/bin/perl -w
3 # Generate a short man page from --help and --version output.
38 my $gettext = Locale::gettext->domain($this_program);
39 sub _ { $gettext->get($_[0]) }
60 my $fmt = $gettext->get(shift);
78 This is free software; see the source for copying conditions. There is NO
85 `%s' generates a man page out of `--help' and `--version' output.
89 -n, --name=STRING description for the NAME paragraph
90 -s, --section=SECTION section number for manual page (1, 6, 8)
91 -m, --manual=TEXT name of manual (User Commands, ...)
92 -S, --source=TEXT source of program (FSF, Debian, ...)
93 -L, --locale=STRING select locale (default "C")
94 -i, --include=FILE include material from `FILE'
95 -I, --opt-include=FILE include material from `FILE' if it exists
96 -o, --output=FILE send output to `FILE'
97 -p, --info-page=TEXT name of Texinfo manual
98 -N, --no-info suppress pointer to Texinfo manual
99 -l, --libtool exclude the `lt-' from the program name
100 --help print this help, then exit
101 --version print version number, then exit
103 EXECUTABLE should accept `--help' and `--version' options and produce output on
106 -h, --help-option=STRING help option string
107 -v, --version-option=STRING version option string
108 --version-string=STRING version string
109 --no-discard-stderr include stderr when parsing option output
111 Report bugs to <bug-help2man@gnu.org>.
117 my $help_option = '--help';
118 my $version_option = '--version';
130 'I|opt-include=s' => sub { push @opt_include, [ pop, 0 ] },
132 'p|info-page=s' => \$opt_info,
133 'N|no-info' => \$opt_no_info,
137 'h|help-option=s' => \$help_option,
138 'v|version-option=s' => \$version_option,
139 'version-string=s' => \$version_text,
140 'discard-stderr!' => \$discard_stderr,
153 my @sections = (); # retain order of include file or in-line *section*s
157 # Optional initial text, ignored. May include lines starting with `-'
182 next unless -f $inc or $required;
239 # Check for options before the first section--anything else is
245 if (/^-/)
254 $hash->{$key} .= $_;
259 kark N_("%s: no valid information found in `%s'"), $this_program, $inc
266 for (keys %$hash) { $hash->{$_} =~ s/\n+$/\n/ }
288 # just use %x as the value (which should be the full locale-specific date).
297 $this_program, $opt_output, $! if -e $opt_output;
303 # The first line of the --version information is assumed to be in one
310 # <program> - {GNU,Free} <package> <version>
317 /^(\S+) +- *((?:GNU|Free) +\S+) +(.*)/)
334 # No info for `info' itself.
339 # --name overrides --include contents.
340 $replace{_('NAME')} = "$program \\- $opt_name\n";
350 $program = $1 if /^([^\s,]+)(?:,?\s*[^\s,\\-]+)*\s+\\?-/;
352 else # Set a default (useless) NAME paragraph.
354 $_ = sprintf _("%s \\- manual page for %s %s") . "\n", $program,
378 # Usage: cp [OPTION]... [-T] SOURCE DEST
380 # or: cp [OPTION]... -t DIRECTORY SOURCE...
398 s/^lt-// if $opt_libtool;
428 s/([A-Za-z])-\n *([A-Za-z])/$1$2/g;
441 # "(?:[\\w-]+ +)?" in the bug reporting pattern is used to indicate an
444 my $PAT_BUGS = _('Report +(?:[\w-]+ +)?bugs|Email +bug +reports +to');
455 # Convert iso-8859-1 copyright symbol or (c) to nroff
528 # Sub-sections have a trailing colon and the second line indented.
539 if (s/^( {1,10}([+-]\S.*?))(?:( +(?!-))|\n( {20,}))(\S.*)\n//)
552 elsif (s/^ {1,10}([+-]\S.*)\n//)
605 s/(^|[ (])(-[][\w=-]+)/$1 . convert_option $2/mge;
612 (?:/\w(?:[\w.-]*\w)?)+ # path components
620 # Escape remaining hyphens.
621 s/-/\x83/g;
631 # Handle multi-line bug reporting sections of the form:
720 s/\x83/\\-/g;
723 s/\xa0/\\ /g; # non-breaking space
735 # Get program basename, and strip libtool "lt-" prefix if required.
740 s/^lt-// if $opt_libtool;
758 ? "\n" . N_("Try `--no-discard-stderr' if option outputs to stderr")
767 # Convert option dashes to \- to stop nroff from hyphenating 'em, and
773 s/-/\x83/g;
784 # Insert spacing escape characters \, and \/ before and after italic text. See
785 # http://www.gnu.org/software/groff/manual/html_node/Ligatures-and-Kerning.html