From 7cf6a6547666f5ebde51d6700198d5f66ce58c38 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Wed, 18 Apr 2012 12:38:03 +0200 Subject: [PATCH] swapoff: cleanup usage() and includes Signed-off-by: Karel Zak --- sys-utils/swapoff.c | 41 +++++++++++++++++------------------------ 1 file changed, 17 insertions(+), 24 deletions(-) diff --git a/sys-utils/swapoff.c b/sys-utils/swapoff.c index 8482026a9..0bd85ac9c 100644 --- a/sys-utils/swapoff.c +++ b/sys-utils/swapoff.c @@ -1,16 +1,6 @@ -#include #include -#include -#include -#include #include -#include -#include -#include -#include -#include -#include -#include +#include #ifdef HAVE_SYS_SWAP_H # include @@ -71,16 +61,19 @@ static int swapoff_by_uuid(const char *uuid, int quiet) return special ? do_swapoff(special, quiet, CANONIC) : cannot_find(uuid); } -static void usage(FILE *out, int n) +static void __attribute__ ((__noreturn__)) usage(FILE * out) { - fputs(_("\nUsage:\n"), out); + fputs(USAGE_HEADER, out); + fprintf(out, _(" %s [options] []\n"), program_invocation_short_name); - fputs(_("\nOptions:\n"), out); + fputs(USAGE_OPTIONS, out); fputs(_(" -a, --all disable all swaps from /proc/swaps\n" - " -h, --help display help and exit\n" - " -v, --verbose verbose mode\n" - " -V, --version display version and exit\n"), out); + " -v, --verbose verbose mode\n"), out); + + fputs(USAGE_SEPARATOR, out); + fputs(USAGE_HELP, out); + fputs(USAGE_VERSION, out); fputs(_("\nThe parameter:\n" \ " -L