changeset 16:74cf5cfa3ec1

rcg.c: add usage help statement
author paulo@thepaulopc
date Thu, 18 Nov 2010 00:31:44 -0800
parents acf12a2e872d
children e618a3ff2027
files rcg.c
diffstat 1 files changed, 18 insertions(+), 1 deletions(-) [+]
line diff
     1.1 --- a/rcg.c	Fri Nov 12 00:13:48 2010 -0800
     1.2 +++ b/rcg.c	Thu Nov 18 00:31:44 2010 -0800
     1.3 @@ -86,7 +86,24 @@
     1.4  
     1.5  Exit_code args_error()
     1.6  {
     1.7 -	fprintf(stderr, "Invalid or nonexistent argument. \n");
     1.8 +	char *usage = "\
     1.9 +Usage: rcg [options] <PATTERN> \n\
    1.10 +\n\
    1.11 +Options: \n\
    1.12 +  -l, --line           Highlight whole line \n\
    1.13 +  -B, --bold           Bold \n\
    1.14 +  -b <color>           Background color \n\
    1.15 +  -f <color>           Foreground color \n\
    1.16 +\n\
    1.17 +<color> can be one of the following: \n\
    1.18 +"; 
    1.19 +
    1.20 +	fprintf(stdout, usage);
    1.21 +
    1.22 +	Colors *c;
    1.23 +	for (c = COLORS; c->name; c++)
    1.24 +		fprintf(stdout, "  %s \n", c->name);
    1.25 +
    1.26  	return EXIT_ARGS_ERROR;
    1.27  } 
    1.28