hlctl/cmdlets/save/save.go

33 lines
682 B
Go
Raw Normal View History

2023-01-07 16:56:15 +00:00
package save
import (
"sectorinf.com/emilis/hlctl/cmdlets"
"sectorinf.com/emilis/hlctl/config"
"sectorinf.com/emilis/hlctl/ctllog"
)
var log = ctllog.Logger{}.New("save", ctllog.Green)
type command struct{}
var Command command
func (command) Name() string {
return "save"
}
func (command) Usage() cmdlets.Usage {
return cmdlets.Usage{
Name: Command.Name(),
Short: "Save the currently loaded configuration to file",
Long: []string{
"`save` simply saves the configurable state of hlctl",
"to a configuration file located at",
"$HOME/.config/herbstluftwm/hlctl.toml",
},
}
}
func (command) Invoke(args ...string) error {
return config.Collect().Save()
}