ianmarmour / nvidia-clerk

A cross-platform go bot that tracks for availability of stock from Nvidia's store and adds a cart to your checkout.
BSD 3-Clause "New" or "Revised" License
222 stars 63 forks source link

Add version command #133

Open redstone2019 opened 4 years ago

redstone2019 commented 4 years ago

Something like nvidia-clerk-windows.exe -version then it says NVIDIA Clerk by Ianmarmour v3.7.6 (09/26/2020)

penguinologist commented 4 years ago

Add it to https://github.com/ianmarmour/nvidia-clerk/blob/master/cmd/nvidia-clerk/nvidia-clerk.go in the flags under main. Something like this should do it (haven't tested it but the gist is here):

        // Parse Argument Flags
    // . . .
    desktop := flag.Bool("desktop", false, "Enable desktop notifications, disabled by default.")
        version := flag.Bool("version", false, "Display program version")
    flag.Parse()
       //  . . .
        if configErr != nil {
        log.Fatal(configErr)
    }

       if config.version != nil{
                log.Println("NVIDIA Clerk by Ianmarmour " + {version} + " " + {date});
                exit
       }