git.shiar.nl
/
barcat.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(from parent 1:
b43c5de
)
short and long help options
author
Mischa POSLAWSKY
<perl@shiar.org>
Thu, 5 Sep 2019 01:02:38 +0000
(
03:02
+0200)
committer
Mischa POSLAWSKY
<perl@shiar.org>
Thu, 5 Sep 2019 03:11:33 +0000
(
05:11
+0200)
Emulate git commands in having -h for usage distinct from --help for full
documentation.
graph
patch
|
blob
|
history
diff --git
a/graph
b/graph
index 16af69ab31f609d651c5bd38f3121dcde019a429..f9d18a9526881f38e63883a93252f737a84e14c2 100755
(executable)
--- a/
graph
+++ b/
graph
@@
-6,8
+6,11
@@
use List::Util qw( max sum );
our $VERSION = '1.00';
use Getopt::Long '2.33';
+sub podexit { require Pod::Usage; Pod::Usage::pod2usage(-exitval => 0, @_) }
GetOptions(\my %opt,
'width|w=i',
+ 'usage|h' => sub { podexit() },
+ 'help' => sub { podexit(-verbose => 2) },
) or exit 64; # EX_USAGE
$opt{width} ||= $ENV{COLUMNS} || 80;