From 1ef364d00e7f799e95a76f435dfd7976091da418 Mon Sep 17 00:00:00 2001 From: P. J. McDermott Date: Sun, 28 Jul 2013 11:38:03 -0400 Subject: pro-archman: Support an -h option. --- (limited to 'src') diff --git a/src/pro-archman.sh b/src/pro-archman.sh index 1800f90..8756b2d 100644 --- a/src/pro-archman.sh +++ b/src/pro-archman.sh @@ -31,6 +31,7 @@ LF=' # Global variables loading_cmd= opt_base_dir= +opt_cmd= conf_incoming_channel= conf_incoming_dir= conf_pool_gc_delay= @@ -85,6 +86,7 @@ main() load_cmds opt_base_dir='.' + opt_cmd='' get_options "${@}" shift $(($OPTIND - 1)) @@ -96,9 +98,12 @@ main() # FIXME: Remove. archive="${opt_base_dir}" - get_conf - - run_cmd "${@}" + if [ "x${opt_cmd}" != 'x' ]; then + run_cmd "${opt_cmd}" "${@}" + else + get_conf + run_cmd "${@}" + fi update_feeds collect_garbage @@ -110,11 +115,14 @@ get_options() { local opt= - while getopts 'b:' opt; do + while getopts 'b:h' opt; do case "${opt}" in 'b') opt_base_dir="$(cd "${OPTARG}" && pwd)" ;; + 'h') + opt_cmd='help' + ;; esac done -- cgit v0.9.1