aboutsummaryrefslogtreecommitdiff
path: root/yes.c
diff options
context:
space:
mode:
Diffstat (limited to 'yes.c')
-rw-r--r--yes.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/yes.c b/yes.c
index ac67845ac..a822ebc1d 100644
--- a/yes.c
+++ b/yes.c
@@ -27,12 +27,18 @@ extern int yes_main(int argc, char **argv)
27{ 27{
28 int i; 28 int i;
29 29
30 if (argc == 1) 30 if (argc >=1 && *argv[1]=='-') {
31 usage("yes [OPTION]... [STRING]...\n\n"
32 "Repeatedly outputs a line with all specified STRING(s), or `y'.\n");
33 }
34
35 if (argc == 1) {
31 while (1) 36 while (1)
32 if (puts("y") == EOF) { 37 if (puts("y") == EOF) {
33 perror("yes"); 38 perror("yes");
34 exit(FALSE); 39 exit(FALSE);
35 } 40 }
41 }
36 42
37 while (1) 43 while (1)
38 for (i = 1; i < argc; i++) 44 for (i = 1; i < argc; i++)