From e7b803df6bbd9a5fc45c02b4a9dcf14500283d0d Mon Sep 17 00:00:00 2001 From: Russ Allbery Date: Wed, 7 Jul 2010 10:30:55 -0700 Subject: Add a help command to wallet-report Add a help command to wallet-report, which returns a summary of all available commands. --- NEWS | 3 +++ server/wallet-report | 27 ++++++++++++++++++++++++++- 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index 738459b..31bf1cc 100644 --- a/NEWS +++ b/NEWS @@ -9,6 +9,9 @@ wallet 0.12 (unreleased) Add an acls duplicate report to wallet-report and Wallet::Report, returning sets of ACLs that have exactly the same entries. + Add a help command to wallet-report, which returns a summary of all + available commands. + wallet 0.11 (2010-03-08) When deleting an ACL on the server, verify that the ACL is not diff --git a/server/wallet-report b/server/wallet-report index 466fe46..7f7ba4d 100755 --- a/server/wallet-report +++ b/server/wallet-report @@ -8,12 +8,31 @@ # See LICENSE for licensing terms. ############################################################################## -# Declarations and site configuration +# Declarations and globals ############################################################################## use strict; use Wallet::Report; +# The help output, sent in reply to the help command. Lists each supported +# report command with a brief description of what it does. +our $HELP = <<'EOH'; +Wallet reporting help: + acls All ACLs + acls duplicate ACLs that duplicate another + acls empty All empty ACLs + acls ACLs containing this entry (wildcarded) + acls unused ACLs that are not referenced by any object + audit acls name ACLs failing the naming policy + audit objects name Objects failing the naming policy + objects All objects + objects acl Objects granting permissions to that ACL + objects flag Objects with that flag set + objects owner Objects owned by that owner + objects type Objects of that type + objects unused Objects that have never been stored/gotten +EOH + ############################################################################## # Implementation ############################################################################## @@ -55,6 +74,8 @@ sub command { print join (' ', @$item), "\n"; } } + } elsif ($command eq 'help') { + print $HELP; } elsif ($command eq 'objects') { die "too many arguments to objects\n" if @args > 2; my @objects = $report->objects (@args); @@ -186,6 +207,10 @@ where is the human-readable name and is the numeric ID. The numeric ID is what's used internally by the wallet system. There will be one line per object or ACL. +=item help + +Displays a summary of all available commands. + =item objects =item objects acl -- cgit v1.2.3