diff --git a/src/deployer.sh b/src/deployer.sh index 3be4411..eb62cc8 100755 --- a/src/deployer.sh +++ b/src/deployer.sh @@ -87,8 +87,8 @@ Mandatory argumentes for long options are mandatory for short options too. -d, --daemon run processing loop in background -e, --errs= name of errors file, default to ${DEFAULT_ERRORS_FILE} + -o, --once stop listening after first request process -q, --quiet set level verbosity to WARN, default to INFO - -s, --stop stop listening after first request process -t, --test just test config file and do not run start loop -v, --verbose set level verbosity to DEBUG, default to INFO @@ -260,8 +260,8 @@ main() ( verbosity_option="" verbosity_level="${DEFAULT_VERBOSITY_LEVEL}" if ! args="$(getopt --name "${PROGRAM_NAME}" \ - --options c:de:hqstv \ - --longoptions conf:,daemon,errs:,help,quiet,stop,test,verbose \ + --options c:de:hoqtv \ + --longoptions conf:,daemon,errs:,help,once,quiet,test,verbose \ -- "$@")"; then usage fail "Bad arguments." @@ -286,6 +286,10 @@ main() ( usage exit 0 ;; + -o | --once) + keep_open="false" + shift + ;; -q | --quiet) if [ "${verbosity_option}" ]; then usage @@ -295,10 +299,6 @@ main() ( ((verbosity_level -= 10)) shift ;; - -s | --stop) - keep_open="false" - shift - ;; -t | --test) testing="true" shift diff --git a/src/runner.sh b/src/runner.sh index 41394a0..e5129e9 100755 --- a/src/runner.sh +++ b/src/runner.sh @@ -81,8 +81,8 @@ Mandatory argumentes for long options are mandatory for short options too. -d, --daemon run processing loop in background -e, --errs= name of errors file, default to ${DEFAULT_ERRORS_FILE} + -o, --once stop listening after first request process -q, --quiet set level verbosity to WARN, default to INFO - -s, --stop stop listening after first request process -t, --test just test config file and do not run start loop -v, --verbose set level verbosity to DEBUG, default to INFO @@ -317,8 +317,8 @@ main() ( verbosity_option="" verbosity_level="${DEFAULT_VERBOSITY_LEVEL}" if ! args="$(getopt --name "${PROGRAM_NAME}" \ - --options c:de:hqstv \ - --longoptions conf:,daemon,errs:,help,quiet,stop,test,verbose \ + --options c:de:hoqtv \ + --longoptions conf:,daemon,errs:,help,once,quiet,test,verbose \ -- "$@")"; then usage fail "Bad arguments." @@ -343,6 +343,10 @@ main() ( usage exit 0 ;; + -o | --once) + keep_open="false" + shift + ;; -q | --quiet) if [ "${verbosity_option}" ]; then usage @@ -352,10 +356,6 @@ main() ( ((verbosity_level -= 10)) shift ;; - -s | --stop) - keep_open="false" - shift - ;; -t | --test) testing="true" shift diff --git a/tests/deployer.bats b/tests/deployer.bats index 028fa1c..d7d2259 100644 --- a/tests/deployer.bats +++ b/tests/deployer.bats @@ -43,7 +43,7 @@ send_request() ( request="$1" "${deployer_bin}" --conf="${conf_file}" --errs="${errs_file}" \ - --daemon --stop --verbose || return $? + --daemon --once --verbose || return $? ( inotifywait --event create --quiet --quiet "${response_sock_dir}" echo "${request}" | ncat --unixsock "${deployer_sock}" diff --git a/tests/runner.bats b/tests/runner.bats index eae58b6..42a79a0 100644 --- a/tests/runner.bats +++ b/tests/runner.bats @@ -46,7 +46,7 @@ send_request() ( ncat --listen --unixsock "${deployer_sock}" & "${runner_bin}" --conf="${conf_file}" --errs="${errs_file}" \ - --daemon --stop --verbose + --daemon --once --verbose code=$? if [ "${code}" -ne 0 ]; then echo "fail" | ncat --unixsock "${deployer_sock}"