Changeset f77dcece045c…
Parent 2d93cd9edad2…
by
Changes to 2 files · Browse files at f77dcece045c Showing diff from parent 2d93cd9edad2 Diff from another changeset...
@@ -116,6 +116,10 @@ fmt.Println(documentation)
}
+func showVersion() {
+ fmt.Println(VERSION)
+}
+
func ensureArgs(n int, explanation string) bool {
if len(os.Args) < n {
fmt.Fprintln(os.Stderr, explanation)
@@ -295,7 +299,7 @@ }
}
case "version":
- fmt.Println(version)
+ showVersion()
default:
showHelp()
}
@@ -309,6 +313,8 @@ if _, err := kiln.GitRoot(); err != nil {
if len(os.Args) == 2 && os.Args[1] == "help" {
showHelp()
+ return
+ } else if len(os.Args) == 2 && os.Args[1] == "version" {
return
} else {
fmt.Fprintln(os.Stderr, "git-kiln must be run from within a Git repository; see \"gitkiln help\"")
|
|
Loading...