Blob Blame Raw
From 68b1b158029501208d1c6a60aa2794d9589c2a08 Mon Sep 17 00:00:00 2001
From: Nikolai Kondrashov <Nikolai.Kondrashov@redhat.com>
Date: Fri, 5 Dec 2014 12:24:37 +0200
Subject: [PATCH 2/3] rad_counter: Refine help message

Refine rad_counter help message:

* use executable name without path,
* add program purpose,
* shorten usage summary line for clarity,
* separate arguments and options,
* add full stops to sentences,
* wrap a long line.
---
 src/modules/rlm_counter/rad_counter | 24 +++++++++++++++---------
 1 file changed, 15 insertions(+), 9 deletions(-)

diff --git a/src/modules/rlm_counter/rad_counter b/src/modules/rlm_counter/rad_counter
index b6c1159..1beef29 100755
--- a/src/modules/rlm_counter/rad_counter
+++ b/src/modules/rlm_counter/rad_counter
@@ -6,6 +6,7 @@ use warnings ;
 use GDBM_File ;
 use Fcntl ;
 use Getopt::Long;
+use File::Basename;
 
 my $user = '';
 my $divisor = 1;
@@ -19,17 +20,22 @@ my $help = 0;
 $filename = '';
 
 sub show_help {
-    print <<"EOF";
-Usage: $0 --file=<counter filename> [--reset=<seconds>] [--match=<regexp>]
-[--user=<username>] [--help] [--hours|--minutes|--seconds]
+    my $progname = basename($0);
+    print <<EOF;
+Usage: $progname --file=<counter filename> [OPTION...]
+Query and maintain FreeRADIUS rlm_counter DB file.
 
---user=<username>               Information for specific user
---file=<filename>               Counter db filename
---match=<regexp>                Information for matching users
+Arguments:
+--file=<filename>               Counter DB filename.
+
+Options:
+--user=<username>               Information for specific user.
+--match=<regexp>                Information for matching users.
 --reset=<number>                Reset counter to <number>.
-                                If divisor is set use it, else <number> means seconds
---help                          Show this help screen
---(hours|minutes|seconds)       Specify information divisor
+                                If divisor is set use it,
+                                else <number> means seconds.
+--help                          Show this help screen.
+--(hours|minutes|seconds)       Specify information divisor.
 EOF
     exit 0;
 }
-- 
2.1.3