Skip to content

Commit

Permalink
Document and test command-line switch '-?'
Browse files Browse the repository at this point in the history
  • Loading branch information
jkeenan authored and khwilliamson committed Dec 24, 2021
1 parent 3a99f1d commit d28cf2c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
7 changes: 6 additions & 1 deletion pod/perlrun.pod
Expand Up @@ -5,7 +5,7 @@ perlrun - how to execute the Perl interpreter
=head1 SYNOPSIS

B<perl> S<[ B<-sTtuUWX> ]>
S<[ B<-hv> ] [ B<-V>[:I<configvar>] ]>
S<[ B<-h?v> ] [ B<-V>[:I<configvar>] ]>
S<[ B<-cw> ] [ B<-d>[B<t>][:I<debugger>] ] [ B<-D>[I<number/list>] ]>
S<[ B<-pna> ] [ B<-F>I<pattern> ] [ B<-l>[I<octal>] ] [ B<-0>[I<octal/hexadecimal>] ]>
S<[ B<-I>I<dir> ] [ B<-m>[B<->]I<module> ] [ B<-M>[B<->]I<'module...'> ] [ B<-f> ]>
Expand Down Expand Up @@ -516,6 +516,11 @@ X<-h>

prints a summary of the options.

=item B<-?>
X<-?>

synonym for B<-h>: prints a summary of the options.

=item B<-i>[I<extension>]
X<-i> X<in-place>

Expand Down
8 changes: 6 additions & 2 deletions t/run/switches.t
Expand Up @@ -12,7 +12,7 @@ BEGIN {

BEGIN { require "./test.pl"; require "./loc_tools.pl"; }

plan(tests => 135);
plan(tests => 136);

use Config;

Expand Down Expand Up @@ -309,7 +309,7 @@ is runperl(stderr => 1, prog => '#!perl -M'),
}
}

# Tests for -h
# Tests for -h and -?

{
local $TODO = ''; # these ones should work on VMS
Expand All @@ -318,6 +318,10 @@ is runperl(stderr => 1, prog => '#!perl -M'),
qr/Usage: .+(?i:perl(?:$Config{_exe})?).+switches.+programfile.+arguments/,
'-h looks okay' );

like( runperl( switches => ['-?'] ),
qr/Usage: .+(?i:perl(?:$Config{_exe})?).+switches.+programfile.+arguments/,
'-? looks okay' );

}

# Tests for switches which do not exist
Expand Down

0 comments on commit d28cf2c

Please sign in to comment.