Browse Source

Markdown.pl: format -h output properly

Make the usage output use the correct termcap codes
to look nice if they're available.

Signed-off-by: Kyle J. McKay <mackyle@gmail.com>
master
Kyle J. McKay 4 years ago
parent
commit
7ce25f1ec9
  1. 10
      Markdown.pl

10
Markdown.pl

@ -313,6 +313,12 @@ BEGIN {%_yamlvis = (
strip => 0
)}
sub _require_pod_usage() {
require Pod::Usage;
eval 'require Pod::Text::Termcap; 1;' and
@Pod::Usage::ISA = (qw( Pod::Text::Termcap ));
}
#### BBEdit/command-line text filter interface ##########################
sub _main {
local *ARGV = \@_;
@ -326,10 +332,10 @@ sub _main {
Getopt::Long::Configure(qw(bundling require_order pass_through));
GetOptions(
'help' => sub {
require Pod::Usage;
_require_pod_usage;
Pod::Usage::pod2usage(-verbose => 2, -exitval => 0)},
'h' => sub {
require Pod::Usage;
_require_pod_usage;
Pod::Usage::pod2usage(-verbose => 0, -exitval => 0)},
'version|V' => sub { # Version info
print "\nThis is Markdown, version $VERSION.\n", $COPYRIGHT;

Loading…
Cancel
Save