shared/verbs: allow commands to specify footer highlighting
In practice I think this will ever only be used with ansi_highlight_red(), but it's cleaner to add this generic extension rather than e.g. a boolean highlight_footer_red. The options is passed through via command_print_help_full(), not through the COMMAND structure, which means that commands with 'help' verb are not covered by this. The red footer highligting is used for legacy commands, which don't have verbs, so I think this is OK. Making it generic and covering 'help' verbs would require more refactoring, and I think it doesn't make sense to add it until it's actually needed.
This commit is contained in:
@@ -181,7 +181,7 @@ int resolvconf_parse_argv(int argc, char *argv[]) {
|
||||
OPTION_NAMESPACE("resolvconf"): {}
|
||||
|
||||
OPTION_COMMON_HELP:
|
||||
return command_print_help_full("resolvconf");
|
||||
return command_print_help_full("resolvconf", /* footer_ansi_seq= */ NULL);
|
||||
|
||||
OPTION_COMMON_VERSION:
|
||||
return version();
|
||||
|
||||
@@ -3498,7 +3498,7 @@ static int native_parse_argv(int argc, char *argv[], char ***remaining_args) {
|
||||
OPTION_NAMESPACE("resolvectl"): {}
|
||||
|
||||
OPTION_COMMON_HELP:
|
||||
return command_print_help_full("resolvectl");
|
||||
return command_print_help_full("resolvectl", /* footer_ansi_seq= */ NULL);
|
||||
|
||||
OPTION_COMMON_VERSION:
|
||||
return version();
|
||||
|
||||
Reference in New Issue
Block a user