diff --git a/usr/local/libexec/rocinante/cmd.sh b/usr/local/libexec/rocinante/cmd.sh index 80ab030..47a1c61 100644 --- a/usr/local/libexec/rocinante/cmd.sh +++ b/usr/local/libexec/rocinante/cmd.sh @@ -32,14 +32,20 @@ . /usr/local/etc/rocinante.conf cmd_usage() { - error_exit "Usage: rocinante cmd command" + error_exit "Usage: rocinante cmd [OPTION] command" } +OPTION="-xc" + # Handle special-case commands first. case "$1" in help|-h|--help) cmd_usage ;; +-q|--quiet) + OPTION="-c" + shift + ;; esac if [ $# -eq 0 ]; then @@ -47,7 +53,8 @@ if [ $# -eq 0 ]; then fi ## execute CMD -sh -c "$@" +info "[CMD]:" +sh "${OPTION}" "$@" ERROR_CODE="$?" info "${ERROR_CODE}"