Skip to content

Commit

Permalink
Release 1.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
ericm committed May 19, 2020
1 parent a6c4b49 commit 25d46e3
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,16 @@ import (
"github.com/spf13/viper"
)

const Version = "1.0.0"

var (
interval,
save,
remove,
name *string
week *bool
days *int
week *bool
version *bool
days *int

configPath string
)
Expand All @@ -47,6 +50,10 @@ func main() {
Short: "A stock visualizer",
Long: "Displays realtime stocks in graph format in a terminal",
Run: func(cmd *cobra.Command, args []string) {
if *version {
fmt.Println(Version)
return
}
if len(*remove) > 0 {
saveCmd := strings.ToLower(*remove)
favourites, ok := viper.Get("favourites").(map[string]interface{})
Expand Down Expand Up @@ -146,6 +153,7 @@ func main() {
save = rootCmd.PersistentFlags().StringP("save", "s", "", "Add an item to the default stonks command. (Eg: -s AMD -n \"Advanced Micro Devices\")")
remove = rootCmd.PersistentFlags().StringP("remove", "r", "", "Remove an item from favourites")
name = rootCmd.PersistentFlags().StringP("name", "n", "", "Optional name for a stonk save")
version = rootCmd.PersistentFlags().BoolP("version", "v", false, "stonks version")

rootCmd.Execute()
}

0 comments on commit 25d46e3

Please sign in to comment.