comparison rcg.c @ 16:74cf5cfa3ec1

rcg.c: add usage help statement
author paulo@thepaulopc
date Thu, 18 Nov 2010 00:31:44 -0800
parents acf12a2e872d
children e618a3ff2027
comparison
equal deleted inserted replaced
13:65b7fdf700a0 14:46fdf490bcf6
84 return EXIT_REALLOC_ERROR; 84 return EXIT_REALLOC_ERROR;
85 } 85 }
86 86
87 Exit_code args_error() 87 Exit_code args_error()
88 { 88 {
89 fprintf(stderr, "Invalid or nonexistent argument. \n"); 89 char *usage = "\
90 Usage: rcg [options] <PATTERN> \n\
91 \n\
92 Options: \n\
93 -l, --line Highlight whole line \n\
94 -B, --bold Bold \n\
95 -b <color> Background color \n\
96 -f <color> Foreground color \n\
97 \n\
98 <color> can be one of the following: \n\
99 ";
100
101 fprintf(stdout, usage);
102
103 Colors *c;
104 for (c = COLORS; c->name; c++)
105 fprintf(stdout, " %s \n", c->name);
106
90 return EXIT_ARGS_ERROR; 107 return EXIT_ARGS_ERROR;
91 } 108 }
92 109
93 // returns regular expression argument 110 // returns regular expression argument
94 char *parseArgs(int argc, char **argv) 111 char *parseArgs(int argc, char **argv)