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"
|
"git.kill0.net/chill9/lume"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Config struct {
|
|
||||||
AccessToken string
|
|
||||||
Colors map[string]string `toml:"colors"`
|
|
||||||
}
|
|
||||||
|
|
||||||
type CmdArgs struct {
|
type CmdArgs struct {
|
||||||
Flags Flags
|
Flags Flags
|
||||||
Client *lifx.Client
|
Client *lifx.Client
|
||||||
Config Config
|
Selector string
|
||||||
}
|
}
|
||||||
|
|
||||||
type Flags struct {
|
type Flags struct {
|
||||||
|
@ -13,8 +13,16 @@ import (
|
|||||||
|
|
||||||
const lumercFile = ".lumerc"
|
const lumercFile = ".lumerc"
|
||||||
|
|
||||||
|
type Config struct {
|
||||||
|
AccessToken string
|
||||||
|
}
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
var config lumecmd.Config
|
var (
|
||||||
|
selector string
|
||||||
|
)
|
||||||
|
|
||||||
|
var config Config
|
||||||
homeDir, err := os.UserHomeDir()
|
homeDir, err := os.UserHomeDir()
|
||||||
_, err = toml.DecodeFile(path.Join(homeDir, lumercFile), &config)
|
_, err = toml.DecodeFile(path.Join(homeDir, lumercFile), &config)
|
||||||
if os.IsNotExist(err) {
|
if os.IsNotExist(err) {
|
||||||
@ -34,7 +42,7 @@ func main() {
|
|||||||
|
|
||||||
cmdArgs := lumecmd.CmdArgs{
|
cmdArgs := lumecmd.CmdArgs{
|
||||||
Client: c,
|
Client: c,
|
||||||
Config: config,
|
Selector: selector,
|
||||||
}
|
}
|
||||||
|
|
||||||
cmd, ok := lumecmd.GetCommand(command)
|
cmd, ok := lumecmd.GetCommand(command)
|
||||||
|
@ -6,7 +6,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
var cmdName string = "toggle"
|
var cmdName string = "set-state"
|
||||||
|
|
||||||
fs := flag.NewFlagSet(cmdName, flag.ExitOnError)
|
fs := flag.NewFlagSet(cmdName, flag.ExitOnError)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user