Changeset 3564

Show
Ignore:
Timestamp:
08/19/08 14:22:31 (4 months ago)
Author:
cstender
Message:

improved vconvert help messages

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • format-plugins/vformat/tools/vconvert.c

    r2795 r3564  
    3939static void usage (char *name, int ecode) 
    4040{ 
    41         fprintf (stderr, "Usage: %s <file> <switches>\n", name); 
     41        fprintf (stderr, "Usage: %s <file> <switches>\n\n", name); 
     42        fprintf (stderr, "Switches:\n"); 
     43        fprintf (stderr, "--help\t\tShow this help message\n"); 
    4244        fprintf (stderr, "--out <file>\tStore the output in this file (No output to stdout)\n"); 
    4345        fprintf (stderr, "--to-vcard21\tConvert to vcard 2.1\n"); 
     
    281283                usage (argv[0], 1); 
    282284 
     285        if (!strcmp (argv[1], "--help")) 
     286                usage (argv[0], 0); 
     287 
    283288        char *filename = argv[1]; 
    284289        char *output = NULL; 
     
    289294        for (i = 2; i < argc; i++) { 
    290295                char *arg = argv[i]; 
    291                 if (!strcmp (arg, "--to-vcard21")) { 
     296                if (!strcmp (arg, "--help")) { 
     297                        usage (argv[0], 0); 
     298                } else if (!strcmp (arg, "--to-vcard21")) { 
    292299                        type = TARGET_VCARD_21; 
    293300                } else if (!strcmp (arg, "--to-vcard30")) { 
     
    312319                        if (!output) 
    313320                                usage (argv[0], 1); 
    314                 } else if (!strcmp (arg, "--help")) { 
    315                         usage (argv[0], 0); 
    316321                } else if (!strcmp (arg, "--")) { 
    317322                        break; 
     
    336341        } 
    337342 
     343        // read file 
    338344        char *buffer; 
    339345        unsigned int size;