Skip to content

Commit

Permalink
Merge pull request #8 from janondrusek/main
Browse files Browse the repository at this point in the history
add CMD trace #6
  • Loading branch information
cedwards authored Jul 11, 2022
2 parents 67b93e4 + 18d8177 commit 727d65e
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions usr/local/libexec/rocinante/cmd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,22 +32,29 @@
. /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
cmd_usage
fi

## execute CMD
sh -c "$@"
info "[CMD]:"
sh "${OPTION}" "$@"
ERROR_CODE="$?"
info "${ERROR_CODE}"

Expand Down

0 comments on commit 727d65e

Please sign in to comment.