Browse Source

Moved git appraise help block to line 71

As suggested, the help block has been moved up. This will now allow
git-appraise help to be ran outside of a repo.
= 4 years ago
parent
commit
2179bea626
1 changed files with 4 additions and 4 deletions
  1. 4 4
      git-appraise/git-appraise.go

+ 4 - 4
git-appraise/git-appraise.go

@@ -68,6 +68,10 @@ func help() {
 }
 
 func main() {
+	if len(os.Args) > 1 && os.Args[1] == "help" {
+		help()
+		return
+	}
 	cwd, err := os.Getwd()
 	if err != nil {
 		fmt.Printf("Unable to get the current working directory: %q\n", err)
@@ -87,10 +91,6 @@ func main() {
 		subcommand.Run(repo, []string{})
 		return
 	}
-	if os.Args[1] == "help" {
-		help()
-		return
-	}
 	subcommand, ok := commands.CommandMap[os.Args[1]]
 	if !ok {
 		fmt.Printf("Unknown command: %q\n", os.Args[1])