Skip to content

Commit

Permalink
added version command
Browse files Browse the repository at this point in the history
  • Loading branch information
oliverisaac committed Jan 19, 2022
1 parent 015c1da commit fca91e8
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ import (
log "github.com/sirupsen/logrus"
)

var version string = "unset-version"
var commit string = "unset-commit"

func main() {
workDir := path.Join(os.TempDir(), "it2cmd")
if dir, isSet := os.LookupEnv("ITERM_CMD_DIR"); isSet {
Expand All @@ -37,6 +40,9 @@ func main() {
var err error
if strings.EqualFold(firstArg, "handle") {
err = handleClick(workDir)
} else if strings.EqualFold(firstArg, "version") {
fmt.Printf("iterm-cmd version: %s (%s)\n", version, commit)
return
} else {
err = handleCreate(workDir)
}
Expand Down

0 comments on commit fca91e8

Please sign in to comment.