From: Christian Goeschel Ndjomouo Date: Fri, 10 Oct 2025 23:17:42 +0000 (-0400) Subject: include/c.h: add USAGE_LIST_COLUMNS_OPTION() macro X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f3e0092ac4415079959bdb4ee293f8a6a7874908;p=thirdparty%2Futil-linux.git include/c.h: add USAGE_LIST_COLUMNS_OPTION() macro With this new macro we no longer have to redundantly specify `fputs(_(" -H, --list-columns...` in the usage() function of ls-like tools, as it will be consolidated to the USAGE_LIST_COLUMNS_OPTION() macro. USAGE_LIST_COLUMNS_OPTION() aligns the option description to the other descriptions in the usage() output in the same way as USAGE_HELP_OPTIONS(). Signed-off-by: Christian Goeschel Ndjomouo --- diff --git a/include/c.h b/include/c.h index c4c73ce9d..f7cd08fd8 100644 --- a/include/c.h +++ b/include/c.h @@ -516,8 +516,13 @@ static inline void __attribute__((__noreturn__)) ul_sig_err(int excode, const ch #define USAGE_DEFAULT_COLUMNS _("\nDefault columns:\n") #define USAGE_SEPARATOR "\n" -#define USAGE_OPTSTR_HELP _("display this help") -#define USAGE_OPTSTR_VERSION _("display version") +#define USAGE_OPTSTR_LIST_COLUMNS _("list the available columns") +#define USAGE_OPTSTR_HELP _("display this help") +#define USAGE_OPTSTR_VERSION _("display version") + +#define USAGE_LIST_COLUMNS_OPTION(marg_dsc) \ + "%-" #marg_dsc "s%s\n" \ + , " -H, --list-columns", USAGE_OPTSTR_LIST_COLUMNS #define USAGE_HELP_OPTIONS(marg_dsc) \ "%-" #marg_dsc "s%s\n" \