chmod: Added default case in option parsing
[mutos-utils.git] / yes.c
blobd5998574f64df6885070df9f417a7885549e926e
1 /*
2 Copyright © 2013 Alastair Stuart
4 This program is open source software: you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation, either version 3 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
15 #include <stdio.h>
16 #include <string.h>
17 #include <stdlib.h>
18 #include <stdbool.h>
20 int main(int argc, char *argv[])
22 if (argc == 1) {
23 for (;;)
25 printf("y\n");
29 for (;;)
31 int i = 0;
32 for (i = 1; i < (argc - 1); i++)
34 printf("%s ", argv[i]);
36 printf("%s\n", argv[argc-1]); // don't print a space for the last arg
39 return 0;