[sheepdog] [PATCH 2/2] man: print detailed usage for sheep if available
MORITA Kazutaka
morita.kazutaka at gmail.com
Thu Aug 15 03:30:21 CEST 2013
From: MORITA Kazutaka <morita.kazutaka at lab.ntt.co.jp>
Signed-off-by: MORITA Kazutaka <morita.kazutaka at lab.ntt.co.jp>
---
script/gen_man.pl | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/script/gen_man.pl b/script/gen_man.pl
index ae8a878..16782a5 100755
--- a/script/gen_man.pl
+++ b/script/gen_man.pl
@@ -16,6 +16,17 @@ sub sheep {
my ($opt, $longopt, $desc) = ($1, $2, $3);
print escape(header("$opt, $longopt") . "\n");
print escape("$desc\n");
+
+ next if ($opt eq '-h');
+
+ # extract detailed help if available
+ my $tmpfile = `mktemp`;
+ chomp($tmpfile);
+ my $help = `$cwd../sheep/sheep $tmpfile $opt 2> /dev/null`;
+ unlink $tmpfile;
+
+ $help =~ s/^\s+\$.+/\n$&\n/mg;
+ print escape("\n$help");
}
}
--
1.7.9.5
More information about the sheepdog
mailing list