ladybird/Userland/Utilities/yes.cpp

25 lines
592 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 03:04:15 +00:00
#include <LibCore/System.h>
#include <stdio.h>
2020-02-18 09:46:06 +00:00
#include <unistd.h>
2022-01-04 03:04:15 +00:00
ErrorOr<int> serenity_main(Main::Arguments arguments)
{
2022-01-04 03:04:15 +00:00
TRY(Core::System::pledge("stdio"));
2020-02-18 09:46:06 +00:00
StringView string = "yes"sv;
Core::ArgsParser args_parser;
args_parser.add_positional_argument(string, "String to output (defaults to 'yes')", "string", Core::ArgsParser::Required::No);
2022-01-04 03:04:15 +00:00
args_parser.parse(arguments);
for (;;)
outln("{}", string);
}