diff options
Diffstat (limited to 'src')
-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 |