mirror of
https://github.com/webmin/webmin.git
synced 2026-05-04 22:30:33 +01:00
Make --help work either before or after subcommand
This commit is contained in:
@@ -44,7 +44,7 @@ sub main {
|
||||
$user->{'twofactor_provider'} = undef;
|
||||
$user->{'twofactor_id'} = undef;
|
||||
$user->{'twofactor_apikey'} = undef;
|
||||
acl::modify_user($user->{'name'}, $user);
|
||||
acl::modify_user($user->{'name'}, $user);
|
||||
reload_miniserv();
|
||||
webmin_log("onefactor", "user", $user->{'name'});
|
||||
|
||||
@@ -111,12 +111,9 @@ Name of the user to disable two-factor authentication for.
|
||||
|
||||
=head1 EXIT CODES
|
||||
|
||||
0 on successfully replacing a config variable
|
||||
0 on successfully replacing configuration options
|
||||
|
||||
1 on successfully adding a new config variable (the specified option did not
|
||||
already exist in the file, and was added)
|
||||
|
||||
>1 on error
|
||||
non-0 on error
|
||||
|
||||
=head1 LICENSE AND COPYRIGHT
|
||||
|
||||
|
||||
@@ -133,7 +133,7 @@ set-config
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
Set a configuration directive in either miniserv.conf (the core Webmin config) or in the specified module config.
|
||||
Set a configuration directive in either C<miniserv.conf> (the core Webmin config) or in the specified module C<config>.
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
|
||||
14
bin/webmin
14
bin/webmin
@@ -34,7 +34,6 @@ sub main {
|
||||
}
|
||||
}
|
||||
);
|
||||
pod2usage(0) if ( $opt{'help'} );
|
||||
|
||||
$opt{'config'} ||= "/etc/webmin";
|
||||
|
||||
@@ -43,7 +42,7 @@ sub main {
|
||||
if ($opt{'list'}) {
|
||||
list_commands(\%opt);
|
||||
exit 0;
|
||||
} elsif ($opt{'man'}) {
|
||||
} elsif ($opt{'man'} || $opt{'help'}) {
|
||||
# Show the full manual page
|
||||
man_command(\%opt, $subcmd);
|
||||
exit 0;
|
||||
@@ -165,6 +164,7 @@ sub list_commands {
|
||||
}
|
||||
}
|
||||
|
||||
# Display either a short usage message (--help) or a full manual (--man)
|
||||
sub man_command {
|
||||
my ($optref, $subcmd) = @_;
|
||||
|
||||
@@ -173,9 +173,13 @@ sub man_command {
|
||||
|
||||
$ENV{'PAGER'} ||= "more";
|
||||
open(my $PAGER, "|-", "$ENV{'PAGER'}");
|
||||
pod2usage( -verbose => 99,
|
||||
-input => $command_path,
|
||||
-output => $PAGER);
|
||||
if ($optref->{'help'}) {
|
||||
pod2usage( -input => $command_path );
|
||||
} else {
|
||||
pod2usage( -verbose => 99,
|
||||
-input => $command_path,
|
||||
-output => $PAGER);
|
||||
}
|
||||
}
|
||||
|
||||
sub root {
|
||||
|
||||
Reference in New Issue
Block a user