breaktime/cmd/start.go

28 lines
481 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()
if !hasArg("-s", args) {
fmt.Println("Timer Started.")
}
},
}
func init() { rootCmd.AddCommand(startCmd) }