summaryrefslogtreecommitdiff
path: root/src/commands/yes.c
diff options
context:
space:
mode:
authorTyler Murphy <tylerm@tylerm.dev>2023-05-01 18:43:32 -0400
committerTyler Murphy <tylerm@tylerm.dev>2023-05-01 18:43:32 -0400
commit82e55dde69dc89fdf06e751b75449f35836282a1 (patch)
tree29e49ae19cba7f6a7c2987c381ebe4b253edc053 /src/commands/yes.c
parentmove back to c99 (diff)
downloadlazysphere-82e55dde69dc89fdf06e751b75449f35836282a1.tar.gz
lazysphere-82e55dde69dc89fdf06e751b75449f35836282a1.tar.bz2
lazysphere-82e55dde69dc89fdf06e751b75449f35836282a1.zip
refactor and xargs
Diffstat (limited to '')
-rw-r--r--src/commands/yes.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/commands/yes.c b/src/commands/yes.c
index c954810..39cf75d 100644
--- a/src/commands/yes.c
+++ b/src/commands/yes.c
@@ -1,19 +1,18 @@
#include "../command.h"
-static void help() {
+static void help(void) {
printf("Usage: yes [STRING]\n\n");
printf("Repeatedly output a line with all specified STRING(s), or 'y'.\n");
- exit(EXIT_SUCCESS);
}
COMMAND(yes) {
+
+ parse_help(argc, argv, help);
+
const char* repeat;
if (argc == 0) {
repeat = "y";
} else {
- if (streql("--help", argv[0])) {
- help();
- }
repeat = argv[0];
for (int i = 1; i < argc; i++) {
*(argv[i]-1) = ' ';