mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 12:17:44 +00:00
yes: Port to LibMain
This commit is contained in:
parent
e9a15995fd
commit
f705f57d9a
2 changed files with 5 additions and 6 deletions
|
@ -165,3 +165,4 @@ target_link_libraries(wasm LibWasm LibLine)
|
||||||
target_link_libraries(whoami LibMain)
|
target_link_libraries(whoami LibMain)
|
||||||
target_link_libraries(watch LibMain)
|
target_link_libraries(watch LibMain)
|
||||||
target_link_libraries(wsctl LibGUI)
|
target_link_libraries(wsctl LibGUI)
|
||||||
|
target_link_libraries(yes LibMain)
|
||||||
|
|
|
@ -5,21 +5,19 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <LibCore/ArgsParser.h>
|
#include <LibCore/ArgsParser.h>
|
||||||
|
#include <LibCore/System.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
int main(int argc, char** argv)
|
ErrorOr<int> serenity_main(Main::Arguments arguments)
|
||||||
{
|
{
|
||||||
if (pledge("stdio", nullptr) < 0) {
|
TRY(Core::System::pledge("stdio"));
|
||||||
perror("pledge");
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
const char* string = "yes";
|
const char* string = "yes";
|
||||||
|
|
||||||
Core::ArgsParser args_parser;
|
Core::ArgsParser args_parser;
|
||||||
args_parser.add_positional_argument(string, "String to output (defaults to 'yes')", "string", Core::ArgsParser::Required::No);
|
args_parser.add_positional_argument(string, "String to output (defaults to 'yes')", "string", Core::ArgsParser::Required::No);
|
||||||
args_parser.parse(argc, argv);
|
args_parser.parse(arguments);
|
||||||
|
|
||||||
for (;;)
|
for (;;)
|
||||||
puts(string);
|
puts(string);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue