Changeset cddcc4a3 in mainline for uspace/app/usbinfo/main.c


Ignore:
Timestamp:
2012-08-14T18:16:39Z (12 years ago)
Author:
Vojtech Horky <vojtechhorky@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
669f5cae
Parents:
76d92db1 (diff), 4802dd7 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge mainline changes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/usbinfo/main.c

    r76d92db1 rcddcc4a3  
    6262
    6363        _OPTION("-h --help", "Print this help and exit.");
     64        _OPTION("-l --list", "Print a list of host controllers and devices.");
    6465        _OPTION("-i --identification", "Brief device identification.");
    6566        _OPTION("-m --match-ids", "Print match ids generated for the device.");
     
    8283        {"help", no_argument, NULL, 'h'},
    8384        {"identification", no_argument, NULL, 'i'},
     85        {"list", no_argument, NULL, 'l'},
    8486        {"match-ids", no_argument, NULL, 'm'},
    8587        {"descriptor-tree", no_argument, NULL, 't'},
     
    9193        {0, 0, NULL, 0}
    9294};
    93 static const char *short_options = "himtTsSrR";
     95static const char *short_options = "hilmtTsSrR";
    9496
    9597static usbinfo_action_t actions[] = {
     
    146148        }
    147149
     150        bool something_active = false;
    148151        /*
    149152         * Process command-line options. They determine what shall be
     
    156159                switch (opt) {
    157160                        case -1:
     161                                break;
     162                        case 'l':
     163                                list();
    158164                                break;
    159165                        case '?':
     
    168174                                        if (actions[idx].opt == opt) {
    169175                                                actions[idx].active = true;
     176                                                something_active = true;
    170177                                                break;
    171178                                        }
     
    178185
    179186        /* Set the default action. */
    180         int idx = 0;
    181         bool something_active = false;
    182         while (actions[idx].opt != 0) {
    183                 if (actions[idx].active) {
    184                         something_active = true;
    185                         break;
    186                 }
    187                 idx++;
    188         }
    189187        if (!something_active) {
    190188                actions[0].active = true;
Note: See TracChangeset for help on using the changeset viewer.