33 lines
682 B
Go
33 lines
682 B
Go
|
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()
|
||
|
}
|