28 lines
450 B
Go
28 lines
450 B
Go
/*
|
|
Copyright © 2023 Brian Buller <brian@bullercodeworks.com>
|
|
|
|
*/
|
|
package cmd
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"github.com/spf13/cobra"
|
|
"github.com/spf13/viper"
|
|
)
|
|
|
|
// startCmd represents the start command
|
|
var startCmd = &cobra.Command{
|
|
Use: "start",
|
|
Short: "Start the timer",
|
|
Run: func(cmd *cobra.Command, args []string) {
|
|
viper.Set("active", true)
|
|
viper.WriteConfig()
|
|
fmt.Println("Timer Started.")
|
|
},
|
|
}
|
|
|
|
func init() {
|
|
rootCmd.AddCommand(startCmd)
|
|
}
|