mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 02:07:35 +00:00
Userland: Use Core::ArgsParser for 'yes'
This commit is contained in:
parent
3cc9e8ba41
commit
cf81d9765c
1 changed files with 9 additions and 9 deletions
|
@ -24,6 +24,7 @@
|
||||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <LibCore/ArgsParser.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
|
@ -34,14 +35,13 @@ int main(int argc, char** argv)
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (argc > 1) {
|
const char* string = "yes";
|
||||||
for (;;) {
|
|
||||||
puts(argv[1]);
|
Core::ArgsParser args_parser;
|
||||||
}
|
args_parser.add_positional_argument(string, "String to output (defaults to 'yes')", "string", Core::ArgsParser::Required::No);
|
||||||
} else {
|
args_parser.parse(argc, argv);
|
||||||
for (;;) {
|
|
||||||
puts("yes");
|
for (;;)
|
||||||
}
|
puts(string);
|
||||||
}
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue