aboutsummaryrefslogtreecommitdiff
path: root/firma
diff options
context:
space:
mode:
authorrhatto <rhatto>2006-10-12 19:22:33 +0000
committerrhatto <rhatto>2006-10-12 19:22:33 +0000
commit4585b123f563e2934545e3b5a5cd3fb1a0edaa66 (patch)
treec87e590bf86ba09f30befdcd1dabaddf8d0f7269 /firma
parenta87a96485569c92dd1f160200b0c9ae8308fc4c1 (diff)
downloadfirma-4585b123f563e2934545e3b5a5cd3fb1a0edaa66.tar.gz
firma-4585b123f563e2934545e3b5a5cd3fb1a0edaa66.tar.bz2
now all admin commands can be accessed via firma --help command
Diffstat (limited to 'firma')
-rwxr-xr-xfirma62
1 files changed, 45 insertions, 17 deletions
diff --git a/firma b/firma
index 20ca56e..f1d2fd2 100755
--- a/firma
+++ b/firma
@@ -1095,6 +1095,7 @@ function ListAdministration {
quit quit this prompt
help show this help
list show list subscribers
+ config list configuration
info EMAIL-ADDRESS show info of a given subscriber
sendkey SUBSCRIBER send list pubkey to subscriber
subscribe [..] subscribe users ('subscribe help' for options)
@@ -1121,17 +1122,21 @@ function ListAdministration {
done
;;
subscribe)
- AdminLog "$1: missing arguments (try \"subscribe help\")"
+ AdminLog "$1: missing arguments (try \"$1 help\")"
return_code=1
;;
sendkey)
- AdminLog "$1: missing arguments (try \"sendkey help\")."
+ AdminLog "$1: missing arguments (try \"$1 help\")."
return_code=1
;;
info)
- AdminLog "$1: missing arguments (try \"info help\")."
+ AdminLog "$1: missing arguments (try \"help\")."
return_code=1
;;
+ config)
+ AdminLog "$1: missing arguments (try \"$1 help\")."
+ return_code=1
+ ;;
*)
AdminLog "Command not found -- $1 (try \"help\")"
return_code=1
@@ -1165,6 +1170,15 @@ function ListAdministration {
GetSubscribersInfo $2
return_code=$?
;;
+ config)
+ if [ "$2" == "help" ]; then
+ ConfigHelp
+ return_code=$?
+ else
+ AdminLog "$1: too many arguments -- $@ (try \"$1 help\")"
+ return_code=1
+ fi
+ ;;
help|quit)
AdminLog "$1: too many arguments -- $@ (try \"help\")"
return_code=1
@@ -1998,6 +2012,26 @@ function SourceListConfig {
REQUIRE_SIGNATURE="`EvalConfigParameter $LIST_CONFIG_FILE REQUIRE_SIGNATURE`"
}
+
+function ConfigHelp {
+ #-------------------------------------------------------------
+ # display help on configuration file parameters
+ #
+ # parameter(s): none
+ # depends on function(s): SourceFirmaConfig, SourceListConfig
+ # returns: 0
+ #-------------------------------------------------------------
+
+ echo "All firma parameters are passed through two different configuration files:"
+ echo "firma.conf, containing general parameters needed to run the script, and a list"
+ echo "specific file, containing its address, administrator(s), etc. In both files"
+ echo "you should enter PARAMETER='value' (with value between single quotes, without"
+ echo "spaces before or after the equal sign and nothing after the second quote)."
+
+ SourceFirmaConfig help
+ SourceListConfig help
+}
+
#-------------------------------------------------------------
# main()
#-------------------------------------------------------------
@@ -2079,7 +2113,8 @@ FUNCTIONS="
CreateMessageBodyPart
EvalConfigParameter
SourceFirmaConfig
- SourceListConfig"
+ SourceListConfig
+ ConfigHelp"
for VAR in $GLOBAL_VARS; do
declare $VAR
@@ -2209,19 +2244,12 @@ case $# in
# valid option called with too many arguments
-h|--help|-v|--version)
if [ "$1" == "-h" ] || [ "$1" == "--help" ]; then
- if [ "$2" == "config" ]; then
- echo "All firma parameters are passed through two different configuration files:"
- echo "firma.conf, containing general parameters needed to run the script, and a list"
- echo "specific file, containing its address, administrator(s), etc. In both files"
- echo "you should enter PARAMETER='value' (without spaces before or after the equal sign)."
- SourceFirmaConfig help
- SourceListConfig help
- EXIT_CODE=0
- else
- echo >&2 "$(basename $0): too many arguments -- $@"
- Usage
- EXIT_CODE=1
- fi
+ ListAdministration $2 help
+ EXIT_CODE=$?
+ else
+ echo >&2 "$(basename $0): too many arguments -- $@"
+ Usage
+ EXIT_CODE=1
fi
;;
*)