Split the existing options into two groups: actions, which actually do something; and options, which modify the actions in some way. Also there's no need to have short flags for all the non-action options. Reserve short flags for the more important actions. While at it: - change a few of the short flags to be more intuitive - make option descriptions more consistently descriptive - sort options in the source like they are when printed - move options to a global struct
Showing the changes to tools/objtool/include/objtool (1 of 9 files). Show all
Unified · Split
| @@ -8,9 +8,29 @@ · 7 unmodified lines | |||
| 8 | #include <subcmd/parse-options.h> | 8 | #include <subcmd/parse-options.h> |
| 9 | 9 | ||
| 10 | extern const struct option check_options[]; | 10 | extern const struct option check_options[]; |
| 11 | extern bool no_fp, no_unreachable, retpoline, module, backtrace, uaccess, stats, | 11 | |
| 12 | lto, vmlinux, mcount, noinstr, backup, sls, dryrun, | 12 | struct opts { |
| 13 | ibt; | 13 | /* actions: */ |
| 14 | bool ibt; | ||
| 15 | bool mcount; | ||
| 16 | bool noinstr; | ||
| 17 | bool retpoline; | ||
| 18 | bool sls; | ||
| 19 | bool uaccess; | ||
| 20 | |||
| 21 | /* options: */ | ||
| 22 | bool backtrace; | ||
| 23 | bool backup; | ||
| 24 | bool dryrun; | ||
| 25 | bool lto; | ||
| 26 | bool module; | ||
| 27 | bool no_fp; | ||
| 28 | bool no_unreachable; | ||
| 29 | bool stats; | ||
| 30 | bool vmlinux; | ||
| 31 | }; | ||
| 32 | |||
| 33 | extern struct opts opts; | ||
| 14 | 34 | ||
| 15 | extern int cmd_parse_options(int argc, const char **argv, const char * const usage[]); | 35 | extern int cmd_parse_options(int argc, const char **argv, const char * const usage[]); |
| 16 | 36 | ||