Add version to user agent
This commit is contained in:
parent
e0a658edf7
commit
761e38fd8e
14
cmd/main.go
14
cmd/main.go
@ -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
3
cmd/version.go
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
package lumecmd
|
||||||
|
|
||||||
|
const Version = "0.1.0"
|
Loading…
Reference in New Issue
Block a user