diff options
author | P. J. McDermott <pjm@nac.net> | 2013-07-28 11:38:03 (EDT) |
---|---|---|
committer | P. J. McDermott <pjm@nac.net> | 2013-07-28 11:38:03 (EDT) |
commit | 1ef364d00e7f799e95a76f435dfd7976091da418 (patch) | |
tree | 5225d015d8dff4e181b5a0455353965992f5ff25 | |
parent | e0e490bb61a8c1ddf8d6c9e70c268ef5aa5230ec (diff) |
pro-archman: Support an -h option.
-rw-r--r-- | src/pro-archman.sh | 16 |
1 files changed, 12 insertions, 4 deletions
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 |