mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-10 18:10:56 +09:00
LibCore: Move AK/ArgsParser to LibCore/CArgsParser
Also rename the classes to match LibCore naming style. This means that it's no longer incorrectly linked into LibC and Kernel.
This commit is contained in:
parent
190111e21a
commit
77dfd419e9
Notes:
sideshowbarker
2024-07-19 14:03:52 +09:00
Author: https://github.com/rburchell
Commit: 77dfd419e9
Pull-request: https://github.com/SerenityOS/serenity/pull/50
10 changed files with 49 additions and 56 deletions
|
@ -4,10 +4,10 @@
|
|||
#include <errno.h>
|
||||
#include <string.h>
|
||||
#include <fcntl.h>
|
||||
#include <AK/ArgsParser.h>
|
||||
#include <AK/AKString.h>
|
||||
#include <AK/StringBuilder.h>
|
||||
#include <AK/Vector.h>
|
||||
#include <LibCore/CArgsParser.h>
|
||||
|
||||
static String read_var(const String& name)
|
||||
{
|
||||
|
@ -104,12 +104,12 @@ static int handle_var(const String& var)
|
|||
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
AK::ArgsParser args_parser("sysctl");
|
||||
CArgsParser args_parser("sysctl");
|
||||
|
||||
args_parser.add_arg("a", "show all variables");
|
||||
args_parser.add_single_value("variable=[value]");
|
||||
|
||||
AK::ArgsParserResult args = args_parser.parse(argc, (const char**)argv);
|
||||
CArgsParserResult args = args_parser.parse(argc, (const char**)argv);
|
||||
|
||||
if (args.is_present("a")) {
|
||||
return handle_show_all();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue