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