mirror of
https://github.com/SerenityOS/serenity.git
synced 2025-01-24 18:32:28 -05:00
usermod: Return error if -L
and -U
options are used simultaneously
This commit is contained in:
parent
089ff7b94e
commit
e86dd1cc89
1 changed files with 7 additions and 0 deletions
|
@ -1,5 +1,6 @@
|
|||
/*
|
||||
* Copyright (c) 2021, Brandon Pruitt <brapru@pm.me>
|
||||
* Copyright (c) 2023, Tim Ledbetter <timledbetter@gmail.com>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
@ -50,6 +51,12 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
|
||||
args_parser.parse(arguments);
|
||||
|
||||
if (lock && unlock) {
|
||||
warnln("The -L and -U options are mutually exclusive");
|
||||
args_parser.print_usage(stderr, arguments.strings[0]);
|
||||
return 1;
|
||||
}
|
||||
|
||||
auto account_or_error = Core::Account::from_name(username);
|
||||
|
||||
if (account_or_error.is_error()) {
|
||||
|
|
Loading…
Add table
Reference in a new issue