Skip to content

Commit 7719333

Browse files
authored
id: retire non-standard -h (#429)
* With this patch, usage string is still printed for -h, but explicit code is not needed for it * Standards document does not mention -h [1] * Fix a typo in the pod document 1. https://pubs.opengroup.org/onlinepubs/009696899/utilities/id.html
1 parent 430a25a commit 7719333

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

bin/id

+4-9
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,9 @@ License:
2121

2222
use strict;
2323
use Getopt::Std;
24-
use vars qw($opt_G $opt_n $opt_u $opt_g $opt_r $opt_a $opt_p $opt_h);
24+
use vars qw($opt_G $opt_n $opt_u $opt_g $opt_r $opt_a $opt_p);
2525

26-
&help unless getopts('Gnuagraph');
27-
&help if ( $opt_h );
26+
getopts('Gnuagrap') or help();
2827
if ( ($opt_G + $opt_g + $opt_p + $opt_u) > 1 ) {
2928
print STDERR "You may only choose one of -G, -g, -p, or -u. Doh!\n\n";
3029
&help;
@@ -163,7 +162,6 @@ sub help {
163162
id -g [-nr] [user]
164163
id -u [-nr] [user]
165164
id -p [user]
166-
id -h
167165
id -a
168166
";
169167
exit 1;
@@ -175,7 +173,7 @@ id - show user information
175173
176174
=head1 SYNOPSIS
177175
178-
id [-Gnuagraph] [user]
176+
id [-Gnuagrap] [user]
179177
180178
=head1 DESCRIPTION
181179
@@ -200,17 +198,14 @@ Nothing. The option is included for compatibility with some versions of id.
200198
=item I<-g>
201199
Display the effective group ID.
202200
203-
=item I<-h>
204-
Display the usage help message.
205-
206201
=item I<-n>
207202
Force the options C<-G>, C<-g> and C<-u> to display the matching name
208203
instead of the number for the user and group IDs. If any of the ID
209204
numbers do not have a matching name, the number will be displayed
210205
as usual.
211206
212207
=item I<-p>
213-
Display the user/group information on seperate lines. If the username
208+
Display the user/group information on separate lines. If the username
214209
returned by getlogin is different than the username associated with
215210
the calling program's user ID, it is displayed preceded by the phrase
216211
"login". The real ID, effective user ID (if different), real group ID,

0 commit comments

Comments
 (0)