diff --git a/Base/res/devel/templates/cpp-basic/main.cpp b/Base/res/devel/templates/cpp-basic/main.cpp index 95efa135c0..0d35edce28 100644 --- a/Base/res/devel/templates/cpp-basic/main.cpp +++ b/Base/res/devel/templates/cpp-basic/main.cpp @@ -1,9 +1,24 @@ #include +#include +#include #include #include -ErrorOr serenity_main(Main::Arguments) +ErrorOr serenity_main(Main::Arguments arguments) { - outln("Hello friends!"); + int hello_count = 1; + StringView epilog; + + Core::ArgsParser parser; + parser.add_option(hello_count, "How often to print \"Hello friends!\"", "count", 'c', "hello-count"); + parser.add_positional_argument(epilog, "What to print at the end", "epilog", Core::ArgsParser::Required::No); + parser.parse(arguments); + + for (auto i = 0; i < hello_count; ++i) + outln("Hello friends!"); + + if (!epilog.is_empty()) + outln("And finally: {}", epilog); + return 0; }