*
*/
-#include "internal.h"
#include <stdio.h>
+#include <stdlib.h>
+#include "busybox.h"
extern int yes_main(int argc, char **argv)
{
int i;
- if (argc >=1 && *argv[1]=='-') {
- usage("yes [OPTION]... [STRING]...\n\n"
- "Repeatedly outputs a line with all specified STRING(s), or `y'.\n");
- }
+ if (argc >= 2 && *argv[1] == '-')
+ show_usage();
if (argc == 1) {
while (1)
if (puts("y") == EOF) {
perror("yes");
- exit(FALSE);
+ return EXIT_FAILURE;
}
}
if (fputs(argv[i], stdout) == EOF
|| putchar(i == argc - 1 ? '\n' : ' ') == EOF) {
perror("yes");
- exit(FALSE);
+ return EXIT_FAILURE;
}
- exit(TRUE);
+
+ return EXIT_SUCCESS;
}