Give all subcommands an optional setup() function that will be called by git-flow in order to let the subcommand initialize its environment.
Give all the branch-type subcommands a default explicit "list" action, too.
Order the functions inside each of the subcommands in a specific order, for consistency:
- usage()
- setup()
- cmd_default()
- cmd_list()
- cmd_help()
- parse_args()
- other commands
diff --git a/git-flow-init b/git-flow-init
index 84ba142..7b1b4b6 100644
--- a/git-flow-init
+++ b/git-flow-init
@@ -16,11 +16,6 @@
echo "usage: git flow init"
}
-cmd_help() {
- usage
- exit 0
-}
-
# Default entry when no SUBACTION is given
cmd_default() {
echo
@@ -76,3 +71,7 @@
fi
}
+cmd_help() {
+ usage
+ exit 0
+}