mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-11 02:13:56 +09:00
ArgsParser: Remove boolean trap on add_arg
Rather than requiring a boolean for whether or not the argument is required, add some new methods to make the purpose of the bool explicit.
This commit is contained in:
parent
5cad215919
commit
729507f2bd
Notes:
sideshowbarker
2024-07-19 14:04:39 +09:00
Author: https://github.com/rburchell
Commit: 729507f2bd
Pull-request: https://github.com/SerenityOS/serenity/pull/50
3 changed files with 22 additions and 10 deletions
|
@ -35,10 +35,10 @@ static int pid_of(const String& process_name, bool single_shot, bool omit_pid, p
|
|||
int main(int argc, char** argv)
|
||||
{
|
||||
AK::ArgsParser args_parser("pidof", "-");
|
||||
|
||||
args_parser.add_arg("s", "Single shot - this instructs the program to only return one pid", false);
|
||||
args_parser.add_arg("o", "pid", "Tells pidof to omit processes with that pid. The special pid %PPID can be used to name the parent process of the pidof program.", false);
|
||||
|
||||
|
||||
args_parser.add_arg("s", "Single shot - this instructs the program to only return one pid");
|
||||
args_parser.add_arg("o", "pid", "Tells pidof to omit processes with that pid. The special pid %PPID can be used to name the parent process of the pidof program.");
|
||||
|
||||
AK::ArgsParserResult args = args_parser.parse(argc, (const char**)argv);
|
||||
|
||||
bool s_arg = args.is_present("s");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue