Ignore:
Timestamp:
Oct 6, 2007, 12:16:46 AM (18 years ago)
Author:
bird
Message:

Added --version and --help to all builtins.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/kmk/kmkbuiltin/kDepIDB.c

    r1165 r1183  
    788788static void usage(const char *argv0)
    789789{
    790     printf("syntax: %s -o <output> -t <target> [-f] [-s] <vc idb-file>\n", argv0);
     790    printf("usage: %s -o <output> -t <target> [-f] [-s] <vc idb-file>\n"
     791           "   or: %s --help\n"
     792           "   or: %s --version\n",
     793           argv0, argv0, argv0);
    791794}
    792795
     
    820823        if (argv[i][0] == '-')
    821824        {
    822             switch (argv[i][1])
     825            const char *psz = &argv[i][1];
     826            if (*psz == '-')
     827            {
     828                if (!strcmp(psz, "-help"))
     829                    psz = "?";
     830                else if (!strcmp(psz, "-version"))
     831                    psz = "v";
     832            }
     833
     834            switch (*psz)
    823835            {
    824836                /*
     
    896908
    897909                /*
     910                 * The mandatory version & help.
     911                 */
     912                case '?':
     913                    usage(argv[0]);
     914                    return 0;
     915                case 'v':
     916                    return kbuild_version(argv[0]);
     917
     918                /*
    898919                 * Invalid argument.
    899920                 */
Note: See TracChangeset for help on using the changeset viewer.