Changes in uspace/app/usbinfo/main.c [9d58539:32260a0] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/usbinfo/main.c
r9d58539 r32260a0 62 62 63 63 _OPTION("-h --help", "Print this help and exit."); 64 _OPTION("-l --list", "Print a list of host controllers and devices."); 64 65 _OPTION("-i --identification", "Brief device identification."); 65 66 _OPTION("-m --match-ids", "Print match ids generated for the device."); … … 82 83 {"help", no_argument, NULL, 'h'}, 83 84 {"identification", no_argument, NULL, 'i'}, 85 {"list", no_argument, NULL, 'l'}, 84 86 {"match-ids", no_argument, NULL, 'm'}, 85 87 {"descriptor-tree", no_argument, NULL, 't'}, … … 91 93 {0, 0, NULL, 0} 92 94 }; 93 static const char *short_options = "hi mtTsSrR";95 static const char *short_options = "hilmtTsSrR"; 94 96 95 97 static usbinfo_action_t actions[] = { … … 146 148 } 147 149 150 bool something_active = false; 148 151 /* 149 152 * Process command-line options. They determine what shall be … … 156 159 switch (opt) { 157 160 case -1: 161 break; 162 case 'l': 163 list(); 158 164 break; 159 165 case '?': … … 168 174 if (actions[idx].opt == opt) { 169 175 actions[idx].active = true; 176 something_active = true; 170 177 break; 171 178 } … … 178 185 179 186 /* 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 }189 187 if (!something_active) { 190 188 actions[0].active = true;
Note:
See TracChangeset
for help on using the changeset viewer.