hishtory/client/cmd/enableDisable.go
2022-11-16 08:03:23 -08:00

33 lines
701 B
Go

package cmd
import (
"github.com/ddworken/hishtory/client/hctx"
"github.com/ddworken/hishtory/client/lib"
"github.com/spf13/cobra"
)
var enableCmd = &cobra.Command{
Use: "enable",
Short: "Enable hiSHtory recording",
GroupID: GROUP_ID_CONFIG,
Run: func(cmd *cobra.Command, args []string) {
ctx := hctx.MakeContext()
lib.CheckFatalError(lib.Enable(ctx))
},
}
var disableCmd = &cobra.Command{
Use: "disable",
Short: "Disable hiSHtory recording",
GroupID: GROUP_ID_CONFIG,
Run: func(cmd *cobra.Command, args []string) {
ctx := hctx.MakeContext()
lib.CheckFatalError(lib.Disable(ctx))
},
}
func init() {
rootCmd.AddCommand(enableCmd)
rootCmd.AddCommand(disableCmd)
}