comparison lcdtest/main.c @ 22:e9df47110181

lcdtest: added ability to specify chdir on the command line
author Mychaela Falconia <falcon@freecalypso.org>
date Sat, 14 Apr 2018 06:15:24 +0000
parents 4194b6744890
children 2127e6fdeab2
comparison
equal deleted inserted replaced
21:1d8c499711f1 22:e9df47110181
20 continue; 20 continue;
21 default: 21 default:
22 /* error msg already printed */ 22 /* error msg already printed */
23 exit(1); 23 exit(1);
24 } 24 }
25 }
26 switch (argc - optind) {
27 case 0:
28 break;
29 case 1:
30 if (chdir(argv[optind]) < 0) {
31 perror(argv[optind]);
32 exit(1);
33 }
34 break;
35 default:
36 fprintf(stderr, "usage: %s [options] [chdir]\n", argv[0]);
37 exit(1);
25 } 38 }
26 } 39 }
27 40
28 main(argc, argv) 41 main(argc, argv)
29 char **argv; 42 char **argv;