mirror of
https://github.com/aditya-K2/gspt.git
synced 2026-01-07 21:13:50 -05:00
Add version and build date
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package config
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"path/filepath"
|
||||
|
||||
@@ -15,6 +16,8 @@ var (
|
||||
UserConfigPath = filepath.Join(configDir, "gspt")
|
||||
Config = NewConfigS()
|
||||
OnConfigChange func()
|
||||
Version = "unknown"
|
||||
BuildDate = "unknown"
|
||||
)
|
||||
|
||||
type ConfigS struct {
|
||||
@@ -43,6 +46,10 @@ func NewConfigS() *ConfigS {
|
||||
func ReadConfig() {
|
||||
parseFlags()
|
||||
|
||||
if Flags.Version {
|
||||
fmt.Printf("gspt %s \nBuild Date: %s\n", Version, BuildDate)
|
||||
}
|
||||
|
||||
// If config path is provided through command-line use that
|
||||
if Flags.ConfigPath != "" {
|
||||
UserConfigPath = Flags.ConfigPath
|
||||
|
||||
@@ -10,6 +10,7 @@ var (
|
||||
|
||||
type Flag struct {
|
||||
ConfigPath string
|
||||
Version bool
|
||||
HideImage bool
|
||||
RoundedCorners bool
|
||||
UseIcons bool
|
||||
@@ -20,6 +21,10 @@ func parseFlags() {
|
||||
"Specify The Directory to check for config.yml file.")
|
||||
flag.BoolVar(&Flags.HideImage, "hide-image", Config.HideImage,
|
||||
"Do not display the cover art image.")
|
||||
flag.BoolVar(&Flags.Version, "v", false,
|
||||
"Do not display the cover art image.")
|
||||
flag.BoolVar(&Flags.Version, "version", false,
|
||||
"Do not display the cover art image.")
|
||||
flag.BoolVar(&Flags.RoundedCorners, "rounded-corners", Config.RoundedCorners,
|
||||
"Enable Rounded Corners")
|
||||
flag.BoolVar(&Flags.UseIcons, "icons", Config.UseIcons,
|
||||
|
||||
Reference in New Issue
Block a user