mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-26 01:20:25 +00:00
ArgsParser: Remove prefix from constructor
It makes sense to keep this consistent between applications, and the purpose of the string is not immediately obvious from an API perspective. If we need to make it configurable later, that can come from a setter.
This commit is contained in:
parent
729507f2bd
commit
c478503581
Notes:
sideshowbarker
2024-07-19 14:04:32 +09:00
Author: https://github.com/rburchell Commit: https://github.com/SerenityOS/serenity/commit/c478503581d Pull-request: https://github.com/SerenityOS/serenity/pull/50
3 changed files with 4 additions and 4 deletions
|
@ -28,8 +28,8 @@ ArgsParser::Arg::Arg(const String& name, const String& value_name, const String&
|
|||
: name(name), description(description), value_name(value_name), required(required)
|
||||
{}
|
||||
|
||||
ArgsParser::ArgsParser(const String& program_name, const String& prefix)
|
||||
: m_program_name(program_name), m_prefix(prefix)
|
||||
ArgsParser::ArgsParser(const String& program_name)
|
||||
: m_program_name(program_name), m_prefix("-")
|
||||
{}
|
||||
|
||||
ArgsParserResult ArgsParser::parse(const int argc, const char** argv)
|
||||
|
|
|
@ -30,7 +30,7 @@ private:
|
|||
|
||||
class ArgsParser {
|
||||
public:
|
||||
ArgsParser(const String& program_name, const String& prefix);
|
||||
ArgsParser(const String& program_name);
|
||||
|
||||
ArgsParserResult parse(const int argc, const char** argv);
|
||||
|
||||
|
|
|
@ -34,7 +34,7 @@ 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", "-");
|
||||
AK::ArgsParser args_parser("pidof");
|
||||
|
||||
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.");
|
||||
|
|
Loading…
Reference in a new issue