Merge pull request #964 from progrium/963-mh-dont-allow-short-args-globally

only look for long args in global space. allows for short args in plugins. closes #963
This commit is contained in:
Jose Diaz-Gonzalez
2015-02-10 13:17:30 -05:00
3 changed files with 8 additions and 7 deletions

View File

@@ -24,7 +24,8 @@ Dokku also supports certain command-line arguments that augment it's behavior. I
in order to avoid ssh interpretting dokku arguments for itself. in order to avoid ssh interpretting dokku arguments for itself.
```shell ```shell
-q|--quiet suppress output headers --quiet suppress output headers
-t|--trace enable DOKKU_TRACE for current execution only --trace enable DOKKU_TRACE for current execution only
--rm|--rm-container remove docker container after successful dokku run <app> <command> --rm|--rm-container remove docker container after successful dokku run <app> <command>
--force force flag. currently used in apps:destroy
``` ```

4
dokku
View File

@@ -19,7 +19,7 @@ source "$PLUGIN_PATH/common/functions"
parse_args "$@" parse_args "$@"
for arg in "$@"; do for arg in "$@"; do
[[ "$arg" =~ ^-.* ]] && shift 1 [[ "$arg" =~ ^--.* ]] && shift 1
done done
! has_tty && DOKKU_QUIET_OUTPUT=1 ! has_tty && DOKKU_QUIET_OUTPUT=1
@@ -150,7 +150,7 @@ case "$1" in
;; ;;
help|'') help|'')
echo "Usage: dokku [-q|--quiet|-t|--trace|--rm-container|--rm] COMMAND <app> [command-specific-options]" echo "Usage: dokku [--quiet|--trace|--rm-container|--rm|--force] COMMAND <app> [command-specific-options]"
echo "" echo ""
echo "Options:" echo "Options:"

View File

@@ -98,16 +98,16 @@ is_image_buildstep_based() {
parse_args() { parse_args() {
for arg in "$@"; do for arg in "$@"; do
case "$arg" in case "$arg" in
--quiet|-q) --quiet)
export DOKKU_QUIET_OUTPUT=1 export DOKKU_QUIET_OUTPUT=1
;; ;;
--trace|-t) --trace)
export DOKKU_TRACE=1 export DOKKU_TRACE=1
;; ;;
--rm-container|--rm) --rm-container|--rm)
export DOKKU_RM_CONTAINER=1 export DOKKU_RM_CONTAINER=1
;; ;;
--force|-f) --force)
export DOKKU_APPS_FORCE_DELETE=1 export DOKKU_APPS_FORCE_DELETE=1
;; ;;
esac esac