diff --git a/bin/disable-twofactor b/bin/disable-twofactor index 12f3cc4e0..a7f42737c 100755 --- a/bin/disable-twofactor +++ b/bin/disable-twofactor @@ -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 diff --git a/bin/set-config b/bin/set-config index 1ade9aae8..db69526a1 100755 --- a/bin/set-config +++ b/bin/set-config @@ -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 (the core Webmin config) or in the specified module C. =head1 SYNOPSIS diff --git a/bin/webmin b/bin/webmin index dc5512508..45b6be504 100755 --- a/bin/webmin +++ b/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 {