su: Default to root if no username is provided
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
apio 2023-04-24 22:24:07 +02:00
parent 919c9dd3cf
commit b8ca749a6c
Signed by: apio
GPG Key ID: B8A7D06E42258954

View File

@ -62,8 +62,8 @@ Result<int> luna_main(int argc, char** argv)
}
os::ArgumentParser parser;
parser.add_description("Switch to a different user."_sv);
parser.add_positional_argument(name, "name"_sv, true);
parser.add_description("Switch to a different user (by default, root)."_sv);
parser.add_positional_argument(name, "name"_sv, "root"_sv);
parser.parse(argc, argv);
struct passwd* entry = getpwnam(name.chars());