From e270d980ca1382e950386cf15970b9ff57f7ed79 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Thu, 10 Sep 2020 11:26:18 +0200 Subject: [PATCH] mkswap: cleanup usage() - don't use one string for all --help output - use USAGE_* macros Signed-off-by: Karel Zak --- disk-utils/mkswap.c | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/disk-utils/mkswap.c b/disk-utils/mkswap.c index af9f1d9e80..b0ecb4cf11 100644 --- a/disk-utils/mkswap.c +++ b/disk-utils/mkswap.c @@ -150,23 +150,21 @@ static void set_uuid_and_label(const struct mkswap_control *ctl) static void __attribute__((__noreturn__)) usage(void) { FILE *out = stdout; - fprintf(out, - _("\nUsage:\n" - " %s [options] device [size]\n"), - program_invocation_short_name); + + fputs(USAGE_HEADER, out); + fprintf(out, _(" %s [options] device [size]\n"), program_invocation_short_name); fputs(USAGE_SEPARATOR, out); fputs(_("Set up a Linux swap area.\n"), out); - fprintf(out, _( - "\nOptions:\n" - " -c, --check check bad blocks before creating the swap area\n" - " -f, --force allow swap size area be larger than device\n" - " -p, --pagesize SIZE specify page size in bytes\n" - " -L, --label LABEL specify label\n" - " -v, --swapversion NUM specify swap-space version number\n" - " -U, --uuid UUID specify the uuid to use\n" - )); + fputs(USAGE_OPTIONS, out); + fputs(_(" -c, --check check bad blocks before creating the swap area\n"), out); + fputs(_(" -f, --force allow swap size area be larger than device\n"), out); + fputs(_(" -p, --pagesize SIZE specify page size in bytes\n"), out); + fputs(_(" -L, --label LABEL specify label\n"), out); + fputs(_(" -v, --swapversion NUM specify swap-space version number\n"), out); + fputs(_(" -U, --uuid UUID specify the uuid to use\n"), out); + fprintf(out, _(" --lock[=] use exclusive device lock (%s, %s or %s)\n"), "yes", "no", "nonblock"); printf(USAGE_HELP_OPTIONS(27)); -- 2.47.2