TT#68300 Fix programs --help output

We should only be printing relevant sections, not the entire man page,
which is rather verbose, and provides information not appropriate for a
--help output.

We use verbose level 1, for the commands that just have SYNOPSIS and
OPTIONS sections, and leave verbose level 99, but specify the relevant
sections which are 'SYNOPSIS|REQUIRED ARGUMENTS|OPTIONS'.

Change-Id: I59d1999599d553c396e60e183592c00e93d1a1db
changes/24/34224/3
Guillem Jover 6 years ago
parent 4e3658c043
commit 15070594a5

@ -30,7 +30,7 @@ sub check_params {
sub usage {
my $missing = shift;
pod2usage(-exitval => $missing ? 1 : 0,
-verbose => 99,
-verbose => 1,
-message => $missing ? "Missing parameters: $missing" : '',
);
return;

@ -36,6 +36,7 @@ sub usage {
my $missing = shift;
pod2usage(-exitval => $missing ? 1 : 0,
-verbose => 99,
-sections => 'SYNOPSIS|REQUIRED ARGUMENTS|OPTIONS',
-message => $missing ? "Missing parameters: $missing" : '',
);
return;

@ -44,6 +44,7 @@ sub usage {
my $missing = shift;
pod2usage(-exitval => $missing ? 1 : 0,
-verbose => 99,
-sections => 'SYNOPSIS|REQUIRED ARGUMENTS|OPTIONS',
-message => $missing ? "Missing parameters: $missing" : '',
);
return;

@ -41,6 +41,7 @@ sub usage {
my $msg = shift;
pod2usage(-exitval => $msg ? 1 : 0,
-verbose => 99,
-sections => 'SYNOPSIS|REQUIRED ARGUMENTS|OPTIONS',
-message => $msg
? $msg =~ /not found/i
? $msg

@ -41,7 +41,7 @@ sub check_params {
sub usage {
my $msg = shift;
pod2usage(-exitval => $msg ? 1 : 0,
-verbose => 99,
-verbose => 1,
-message => $msg
? $msg =~ /not found/i
? $msg

@ -37,6 +37,7 @@ sub usage {
my $msg = shift;
pod2usage(-exitval => $msg ? 1 : 0,
-verbose => 99,
-sections => 'SYNOPSIS|REQUIRED ARGUMENTS|OPTIONS',
-message => $msg
? $msg =~ /not found/i
? $msg

@ -58,7 +58,7 @@ sub check_params {
sub usage {
my $msg = shift;
pod2usage(-exitval => $msg ? 1 : 0,
-verbose => 99,
-verbose => 1,
-message => $msg
? $msg =~ /not found/i
? $msg

@ -32,6 +32,7 @@ sub usage {
my $missing = shift;
pod2usage(-exitval => $missing ? 1 : 0,
-verbose => 99,
-sections => 'SYNOPSIS|REQUIRED ARGUMENTS|OPTIONS',
-message => $missing ? "Missing parameters: $missing" : '',
);
return;

@ -32,6 +32,7 @@ sub usage {
my $missing = shift;
pod2usage(-exitval => $missing ? 1 : 0,
-verbose => 99,
-sections => 'SYNOPSIS|REQUIRED ARGUMENTS|OPTIONS',
-message => $missing ? "Missing parameters: $missing" : '',
);
return;

@ -32,6 +32,7 @@ sub usage {
my $missing = shift;
pod2usage(-exitval => $missing ? 1 : 0,
-verbose => 99,
-sections => 'SYNOPSIS|REQUIRED ARGUMENTS|OPTIONS',
-message => $missing ? "Missing parameters: $missing" : '',
);
return;

@ -33,6 +33,7 @@ sub usage {
my $msg = shift;
pod2usage(-exitval => $msg ? 1 : 0,
-verbose => 99,
-sections => 'SYNOPSIS|REQUIRED ARGUMENTS|OPTIONS',
-message => $msg
? $msg =~ /not found/i
? $msg

Loading…
Cancel
Save