breaktime/cmd/stop.go
2023-03-31 11:07:03 -05:00

28 lines
445 B
Go

/*
Copyright © 2023 Brian Buller <brian@bullercodeworks.com>
*/
package cmd
import (
"fmt"
"github.com/spf13/cobra"
"github.com/spf13/viper"
)
// stopCmd represents the stop command
var stopCmd = &cobra.Command{
Use: "stop",
Short: "Stop the timer",
Run: func(cmd *cobra.Command, args []string) {
viper.Set("active", false)
viper.WriteConfig()
fmt.Println("Timer Stopped.")
},
}
func init() {
rootCmd.AddCommand(stopCmd)
}