diff --git a/cmd/main.go b/cmd/main.go index 1cb2eef..996d6b5 100644 --- a/cmd/main.go +++ b/cmd/main.go @@ -6,14 +6,17 @@ import ( "fmt" "os" "path" + "strings" lifx "git.kill0.net/chill9/lume" "github.com/BurntSushi/toml" ) -const userAgent = "lume" +var userAgent string func init() { + userAgent = initUserAgent() + RegisterCommand("help", Command{ Func: HelpCmd, Flags: func() *flag.FlagSet { @@ -274,3 +277,12 @@ func getConfigPath() string { return configPath } + +func initUserAgent() string { + var b strings.Builder + + b.WriteString("lume") + b.WriteRune('/') + b.WriteString(Version) + return b.String() +} diff --git a/cmd/version.go b/cmd/version.go new file mode 100644 index 0000000..c508882 --- /dev/null +++ b/cmd/version.go @@ -0,0 +1,3 @@ +package lumecmd + +const Version = "0.1.0"