Skip to content

Commit

Permalink
Add version argument to display current Sentinel version
Browse files Browse the repository at this point in the history
  • Loading branch information
dmitrykuzmenkov committed Nov 2, 2015
1 parent 1b084f2 commit 2a14ea0
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 3 deletions.
3 changes: 2 additions & 1 deletion sentinel
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ load_component "args" "helper" "sentinel"
parse_args "$@"

# Show help?
test -n "$HELP" && source ./src/help.bash && exit 1
test -n "$ARG_HELP" && source ./src/help.bash && exit 0
test -n "$ARG_VERSION" && echo 'Sentinel version: '$VERSION && exit 0

# Status commands
test -n "$ARG_STATUS" && load_component "status" && display_task_status "$ARG_STATUS" && exit 0
Expand Down
5 changes: 4 additions & 1 deletion src/args.bash
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,11 @@ parse_args() {
--task-example)
export TASK_EXAMPLE=1
;;
--version|-v)
export ARG_VERSION=1
;;
--help|-h)
export HELP=1
export ARG_HELP=1
;;
*) # unknown option
;;
Expand Down
1 change: 1 addition & 0 deletions src/env.bash
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/bin/bash
export VERSION='0.1.0-pre'
export CHECK_TIMEOUT=3
export TASKS_DIR='./tasks'
export WORK_DIR='./proc'
Expand Down
2 changes: 1 addition & 1 deletion src/help.bash
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,6 @@ Gathering info about running processes:
--status=# Get status for # task name
Other:
--version -v Display current Sentinel's version
--help -h Display this help
EOF

0 comments on commit 2a14ea0

Please sign in to comment.