Ticket #316: convcard.make_help_clearer.patch

File convcard.make_help_clearer.patch, 1.5 KB (added by puck, 6 years ago)

And make the help for convcard a littler clearer, and fix an off by one error which stopped --help from working.

  • tools/convcard.c

     
    2828 
    2929static void usage (char *name, int ecode) 
    3030{ 
    31   fprintf (stderr, "Usage: %s\n", name); 
    32   fprintf (stderr, "%s <file>\tFilename is the vcard to convert. Output will go to stdout.\n", name); 
    33   fprintf (stderr, "--out <file>\tStore the output in this file (No output to stdout)\n"); 
    34   fprintf (stderr, "--from-vcard2.1\tTreat file as 2.1 vcard (No autodetection)\n"); 
    35   fprintf (stderr, "--from-vcard3.0\tTreat file as 3.0 vcard (No autodetection)\n"); 
     31  fprintf (stderr, "Usage: %s [options] <source>\n\n", name); 
     32        fprintf (stderr, "Converts a vCard version 2.1 in a vCard version 3.0 and vice versa.\n"); 
     33        fprintf (stderr, "By default the source file format is autodetected, and is converted to\n"); 
     34        fprintf (stderr, "the other format.\n\n"); 
     35        fprintf (stderr, "One of the tools from OpenSync.\n\n"); 
     36        fprintf (stderr, "Options:\n"); 
     37  fprintf (stderr, "  <source>\t\tThe vcard to convert.\n"); 
     38  fprintf (stderr, "  --out <file>\t\tSave the output in <file>.  Default is stdout.\n"); 
     39  fprintf (stderr, "  --from-vcard2.1\tTreat <source> as 2.1 vcard.\n"); 
     40  fprintf (stderr, "  --from-vcard3.0\tTreat <source> as 3.0 vcard.\n"); 
    3641  exit (ecode); 
    3742} 
    3843 
     
    116121        OSyncObjFormat *targetformat = NULL; 
    117122         
    118123        int i; 
    119         for (i = 2; i < argc; i++) { 
     124        for (i = 1; i < argc; i++) { 
    120125                char *arg = argv[i]; 
    121126                if (!strcmp (arg, "--from-vcard2.1")) { 
    122127                        type = DETECT_VCARD_21;