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-version b/git-flow-version
index cbb66b6..e394de9 100644
--- a/git-flow-version
+++ b/git-flow-version
@@ -17,11 +17,11 @@
echo "usage: git flow version"
}
+cmd_default() {
+ echo "$GITFLOW_VERSION"
+}
+
cmd_help() {
usage
exit 0
}
-
-cmd_default() {
- echo "$GITFLOW_VERSION"
-}