diff options
author | Robin Burchell <robin+git@viroteck.net> | 2019-05-17 12:59:37 +0200 |
---|---|---|
committer | Andreas Kling <awesomekling@gmail.com> | 2019-05-17 15:49:37 +0200 |
commit | c478503581dbc89d1483398e760e5e59f4c07f79 (patch) | |
tree | c77abf2eeb31d5b9770eac8ee4d8a9e3e1d11994 | |
parent | 729507f2bde0a9ec4324f51c68c5646d593605f8 (diff) | |
download | serenity-c478503581dbc89d1483398e760e5e59f4c07f79.zip |
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.
-rw-r--r-- | AK/ArgsParser.cpp | 4 | ||||
-rw-r--r-- | AK/ArgsParser.h | 2 | ||||
-rw-r--r-- | Userland/pidof.cpp | 2 |
3 files changed, 4 insertions, 4 deletions
diff --git a/AK/ArgsParser.cpp b/AK/ArgsParser.cpp index d98fffcea3..0e2b629775 100644 --- a/AK/ArgsParser.cpp +++ b/AK/ArgsParser.cpp @@ -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) diff --git a/AK/ArgsParser.h b/AK/ArgsParser.h index 856e1ed976..8879b127bc 100644 --- a/AK/ArgsParser.h +++ b/AK/ArgsParser.h @@ -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); diff --git a/Userland/pidof.cpp b/Userland/pidof.cpp index a0909cb88d..1a749abf88 100644 --- a/Userland/pidof.cpp +++ b/Userland/pidof.cpp @@ -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."); |