ladybird/Userland/Utilities/yes.cpp

25 lines
584 B
C++
Raw Normal View History

/*
* Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#include <LibCore/ArgsParser.h>
2022-01-04 06:04:15 +03:00
#include <LibCore/System.h>
#include <stdio.h>
2020-02-18 12:46:06 +03:00
#include <unistd.h>
2022-01-04 06:04:15 +03:00
ErrorOr<int> serenity_main(Main::Arguments arguments)
{
2022-01-04 06:04:15 +03:00
TRY(Core::System::pledge("stdio"));
2020-02-18 12:46:06 +03:00
2022-04-01 20:58:27 +03:00
char const* string = "yes";
Core::ArgsParser args_parser;
args_parser.add_positional_argument(string, "String to output (defaults to 'yes')", "string", Core::ArgsParser::Required::No);
2022-01-04 06:04:15 +03:00
args_parser.parse(arguments);
for (;;)
puts(string);
}