Compare commits
No commits in common. "6b033f10de4f9748f00922c5740ea5b063bb2c54" and "1b054466cf0efa363bd967b2dbbaf94ad172ae0a" have entirely different histories.
6b033f10de
...
1b054466cf
@ -8,15 +8,10 @@ import (
|
||||
"git.kill0.net/chill9/lume"
|
||||
)
|
||||
|
||||
type Config struct {
|
||||
AccessToken string
|
||||
Colors map[string]string `toml:"colors"`
|
||||
}
|
||||
|
||||
type CmdArgs struct {
|
||||
Flags Flags
|
||||
Client *lifx.Client
|
||||
Config Config
|
||||
Flags Flags
|
||||
Client *lifx.Client
|
||||
Selector string
|
||||
}
|
||||
|
||||
type Flags struct {
|
||||
|
@ -13,8 +13,16 @@ import (
|
||||
|
||||
const lumercFile = ".lumerc"
|
||||
|
||||
type Config struct {
|
||||
AccessToken string
|
||||
}
|
||||
|
||||
func main() {
|
||||
var config lumecmd.Config
|
||||
var (
|
||||
selector string
|
||||
)
|
||||
|
||||
var config Config
|
||||
homeDir, err := os.UserHomeDir()
|
||||
_, err = toml.DecodeFile(path.Join(homeDir, lumercFile), &config)
|
||||
if os.IsNotExist(err) {
|
||||
@ -33,8 +41,8 @@ func main() {
|
||||
c := lifx.NewClient(config.AccessToken)
|
||||
|
||||
cmdArgs := lumecmd.CmdArgs{
|
||||
Client: c,
|
||||
Config: config,
|
||||
Client: c,
|
||||
Selector: selector,
|
||||
}
|
||||
|
||||
cmd, ok := lumecmd.GetCommand(command)
|
||||
|
@ -6,7 +6,7 @@ import (
|
||||
)
|
||||
|
||||
func init() {
|
||||
var cmdName string = "toggle"
|
||||
var cmdName string = "set-state"
|
||||
|
||||
fs := flag.NewFlagSet(cmdName, flag.ExitOnError)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user