From ea276533fbc9da4588d4707c1a21a9d480924b3c Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Tue, 9 Nov 2010 10:30:07 -0800 Subject: Simplify options list for usage from array to constant string Signed-off-by: Alan Coopersmith --- xkill.c | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/xkill.c b/xkill.c index d7cee73..18f5450 100644 --- a/xkill.c +++ b/xkill.c @@ -73,22 +73,18 @@ Exit(int code) static void usage(void) { - static char *options[] = { -"where options include:", -" -display displayname X server to contact", -" -id resource resource whose client is to be killed", -" -frame don't ignore window manager frames", -" -button number specific button to be pressed to select window", -" -all kill all clients with top level windows", -"", -NULL}; + const char *options = +"where options include:\n" +" -display displayname X server to contact\n" +" -id resource resource whose client is to be killed\n" +" -frame don't ignore window manager frames\n" +" -button number specific button to be pressed to select window\n" +" -all kill all clients with top level windows\n" +"\n"; char **cpp; - fprintf (stderr, "usage: %s [-option ...]\n", - ProgramName); - for (cpp = options; *cpp; cpp++) { - fprintf (stderr, "%s\n", *cpp); - } + fprintf (stderr, "usage: %s [-option ...]\n%s", + ProgramName, options); Exit (1); } -- cgit v1.2.3