1. Summary
  2. Files
  3. Support
  4. Report Spam
  5. Create account
  6. Log in

Changeset 1890

Show
Ignore:
Timestamp:
09/15/11 12:49:57 (21 months ago)
Author:
jkoshy
Message:

Improve the level of detail in the usage messages printed by ar
and ranlib.

Ticket: #324

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/ar/ar.c

    r1793 r1890  
    373373} 
    374374 
     375static const char *ar_usagemsg = "\ 
     376Usage: %s <command> [options] archive file...\n\ 
     377  Manage archives.\n\n\ 
     378  Where <command> is one of:\n\ 
     379  -d            Delete members from the archive.\n\ 
     380  -m            Move archive members within the archive.\n\ 
     381  -p            Write the contents of members to standard output.\n\ 
     382  -q            Append files to an archive.\n\ 
     383  -r            Replace (add) files to an archive.\n\ 
     384  -s            Add an archive symbol to an archive.\n\ 
     385  -t            List files in an archive.\n\ 
     386  -x            Extract members from an archive.\n\ 
     387  -M            Execute MRI librarian commands.\n\ 
     388  -V            Print a version identifier and exit.\n\n\ 
     389  Options:\n\ 
     390  -a MEMBER     Add members after the specified member.\n\ 
     391  -b MEMBER | -i MEMBER\n\ 
     392                Add members before the specified member.\n\ 
     393  -c            Do not print a message when creating a new archive.\n\ 
     394  -f | -T       Only use the first fifteen characters of the member name.\n\ 
     395  -j            (This option is accepted, but is ignored).\n\ 
     396  -l            (This option is accepted, but is ignored).\n\ 
     397  -o            Preserve modification times when extracting members.\n\ 
     398  -u            Conditionally update or extract members.\n\ 
     399  -v            Be verbose.\n\ 
     400  -z            (This option is accepted, but is ignored).\n\ 
     401  -C            Do not overwrite existing files in the file system.\n\ 
     402  -D            Use fixed metadata, for consistent archive checksums.\n\ 
     403  -F FORMAT | --flavor=FORMAT\n\ 
     404                Create archives with the specified format.\n\ 
     405  -S            Do not generate an archive symbol table.\n\ 
     406"; 
     407 
    375408static void 
    376409bsdar_usage() 
    377410{ 
    378  
    379         (void)fprintf(stderr, "usage:  ar -d [-Tjsvz] archive file ...\n"); 
    380         (void)fprintf(stderr, "\tar -m [-Tjsvz] archive file ...\n"); 
    381         (void)fprintf(stderr, "\tar -m [-Tabijsvz] position archive file ...\n"); 
    382         (void)fprintf(stderr, "\tar -p [-Tv] archive [file ...]\n"); 
    383         (void)fprintf(stderr, "\tar -q [-TcDjsvz] [-F flavor] archive file ...\n"); 
    384         (void)fprintf(stderr, "\tar -r [-TcDjsuvz] [-F flavor] archive file ...\n"); 
    385         (void)fprintf(stderr, "\tar -r [-TabcDijsuvz] [-F flavor] position archive file ...\n"); 
    386         (void)fprintf(stderr, "\tar -s [-jz] archive\n"); 
    387         (void)fprintf(stderr, "\tar -t [-Tv] archive [file ...]\n"); 
    388         (void)fprintf(stderr, "\tar -x [-CTouv] archive [file ...]\n"); 
    389         (void)fprintf(stderr, "\tar -V\n"); 
     411        (void) fprintf(stderr, ar_usagemsg, ELFTC_GETPROGNAME()); 
    390412        exit(EX_USAGE); 
    391413} 
     414 
     415static const char *ranlib_usagemsg = "\ 
     416Usage: %s [options] archive...\n\ 
     417  Update or create archive symbol tables.\n\n\ 
     418  Options:\n\ 
     419  -t              (This option is accepted, but ignored).\n\ 
     420  -D              Use fixed metadata, for consistent archive checksums.\n\ 
     421  -V              Print a version identifier and exit.\n\ 
     422"; 
    392423 
    393424static void 
    394425ranlib_usage() 
    395426{ 
    396  
    397         (void)fprintf(stderr, "usage:   ranlib [-t] archive ...\n"); 
    398         (void)fprintf(stderr, "\tranlib -V\n"); 
     427        (void)fprintf(stderr, ranlib_usagemsg, ELFTC_GETPROGNAME()); 
    399428        exit(EX_USAGE); 
    400429}