mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-12-28 21:54:40 +03:00
Userland: Use Core::ArgsParser for 'yes'
This commit is contained in:
parent
3cc9e8ba41
commit
cf81d9765c
Notes:
sideshowbarker
2024-07-19 04:12:35 +09:00
Author: https://github.com/linusg Commit: https://github.com/SerenityOS/serenity/commit/cf81d9765c7 Pull-request: https://github.com/SerenityOS/serenity/pull/3019
@ -24,6 +24,7 @@
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include <LibCore/ArgsParser.h>
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
|
||||
@ -34,14 +35,13 @@ int main(int argc, char** argv)
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (argc > 1) {
|
||||
for (;;) {
|
||||
puts(argv[1]);
|
||||
}
|
||||
} else {
|
||||
for (;;) {
|
||||
puts("yes");
|
||||
}
|
||||
}
|
||||
const char* string = "yes";
|
||||
|
||||
Core::ArgsParser args_parser;
|
||||
args_parser.add_positional_argument(string, "String to output (defaults to 'yes')", "string", Core::ArgsParser::Required::No);
|
||||
args_parser.parse(argc, argv);
|
||||
|
||||
for (;;)
|
||||
puts(string);
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user