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:
Robin Burchell 2019-05-17 12:59:37 +02:00 committed by Andreas Kling
parent 729507f2bd
commit c478503581
Notes: sideshowbarker 2024-07-19 14:04:32 +09:00
3 changed files with 4 additions and 4 deletions

View file

@ -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)

View file

@ -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);

View file

@ -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.");