Compare commits

..

2 Commits

Author SHA1 Message Date
761e38fd8e
Add version to user agent 2021-02-13 18:42:47 -06:00
e0a658edf7
Minor change to library user agent 2021-02-13 18:42:07 -06:00
3 changed files with 17 additions and 2 deletions

View File

@ -13,7 +13,7 @@ import (
"time" "time"
) )
const defaultUserAgent = "go-lifx" const defaultUserAgent = "lifx-go"
type ( type (
Client struct { Client struct {

View File

@ -6,14 +6,17 @@ import (
"fmt" "fmt"
"os" "os"
"path" "path"
"strings"
lifx "git.kill0.net/chill9/lume" lifx "git.kill0.net/chill9/lume"
"github.com/BurntSushi/toml" "github.com/BurntSushi/toml"
) )
const userAgent = "lume" var userAgent string
func init() { func init() {
userAgent = initUserAgent()
RegisterCommand("help", Command{ RegisterCommand("help", Command{
Func: HelpCmd, Func: HelpCmd,
Flags: func() *flag.FlagSet { Flags: func() *flag.FlagSet {
@ -274,3 +277,12 @@ func getConfigPath() string {
return configPath return configPath
} }
func initUserAgent() string {
var b strings.Builder
b.WriteString("lume")
b.WriteRune('/')
b.WriteString(Version)
return b.String()
}

3
cmd/version.go Normal file
View File

@ -0,0 +1,3 @@
package lumecmd
const Version = "0.1.0"