Skip to content

Commit

Permalink
added a version string to the constants and started using it
Browse files Browse the repository at this point in the history
  • Loading branch information
YashdalfTheGray committed Feb 28, 2020
1 parent 1da0e63 commit 5730c9d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions constants/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package constants

// These are some constants for the application
const (
Version = "1.0.0"
EnvAWSAccessKeyID = "AWS_ACCESS_KEY_ID"
EnvAWSSecretAccessKey = "AWS_SECRET_ACCESS_KEY"
EnvAWSSessionToken = "AWS_SESSION_TOKEN"
Expand Down
4 changes: 4 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ func main() {
os.Exit(0)
break
case "-h", "--help":
fmt.Println(fmt.Sprintf("\nfederator %s", constants.Version))
fmt.Println("\nUsage: federator <subcommand> <options>")
fmt.Println("Options for the link subcommand")
linkCmd.SetOutput(os.Stdout)
Expand All @@ -98,6 +99,9 @@ func main() {
fmt.Println("\nUse `federator -h` or `federator --help` to display this help text.")
os.Exit(0)
break
case "-v", "--version":
fmt.Println(fmt.Sprintf("\nfederator %s", constants.Version))
fmt.Println("Use `federator -h` or `federator --help` to display help text.")
default:
log.Fatalln(fmt.Sprintf("Invalid subcommand, %s. Valid options are link, creds", os.Args[1]))
}
Expand Down

0 comments on commit 5730c9d

Please sign in to comment.