Skip to content

Commit

Permalink
rad_counter: Use heredoc for help message
Browse files Browse the repository at this point in the history
Use Perl's here document syntax for rad_counter's help message and
replace tab escape sequences with spaces to make the source more
readable and easier to modify.
  • Loading branch information
spbnick committed Dec 5, 2014
1 parent acc89c9 commit 2d858f1
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions src/modules/rlm_counter/rad_counter
Expand Up @@ -19,15 +19,18 @@ my $help = 0;
$filename = '';

sub show_help {
print "Usage: $0 --file=<counter filename> [--reset=<seconds>] [--match=<regexp>]\n";
print "[--user=<username>] [--help] [--hours|--minutes|--seconds]\n\n";
print "--user=<username>", "\t\t", "Information for specific user\n";
print "--file=<filename>", "\t\t", "Counter db filename\n";
print "--match=<regexp>", "\t\t", "Information for matching users\n";
print "--reset=<number>", "\t\t", "Reset counter to <number>.\n";
print "\t\t\t\t", "If divisor is set use it, else <number> means seconds\n";
print "--help", "\t\t\t\t", "Show this help screen\n";
print "--(hours|minutes|seconds)", "\t", "Specify information divisor\n";
print <<"EOF";
Usage: $0 --file=<counter filename> [--reset=<seconds>] [--match=<regexp>]
[--user=<username>] [--help] [--hours|--minutes|--seconds]
--user=<username> Information for specific user
--file=<filename> Counter db filename
--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
EOF
exit 0;
}

Expand Down

0 comments on commit 2d858f1

Please sign in to comment.