Skip to content

Commit

Permalink
Added initial implementation of using shFlags.
Browse files Browse the repository at this point in the history
  • Loading branch information
nvie committed Jan 30, 2010
1 parent 42600d9 commit ea58d0f
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions git-flow
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,13 @@ main() {
exit 1
fi

# use the shFlags project to parse the command line arguments
. "$GITFLOW_DIR/shFlags/src/shFlags"
#DEFINE_boolean quiet 0 'run without output' q
#DEFINE_boolean verbose 0 'run verbose (more output)' v
FLAGS "$@" || exit $?
eval set -- "${FLAGS_ARGV}"

# sanity checks
SUBCOMMAND="$1"; shift

Expand All @@ -73,6 +80,11 @@ main() {
# run command
. "$GITFLOW_DIR/git-flow-$SUBCOMMAND"

#
# TODO: How to handle 'git flow feature --verbose'
# instead of 'git flow feature list --verbose'
# "--verbose" is not a subcommand!
#
SUBACTION="${1:-default}"; shift
if ! typeset -f cmd_$SUBACTION 2>&1 >/dev/null; then
warn "Unknown subcommand: '$1'"
Expand Down

0 comments on commit ea58d0f

Please sign in to comment.