breaktime/cmd/break.go

25 lines
425 B
Go

/*
Copyright © 2023 Brian Buller <brian@bullercodeworks.com>
*/
package cmd
import (
"time"
"github.com/spf13/cobra"
"github.com/spf13/viper"
)
// breakCmd represents the break command
var breakCmd = &cobra.Command{
Use: "break",
Short: "Start a break",
Run: func(cmd *cobra.Command, args []string) {
viper.Set("lastbreak", time.Now())
viper.WriteConfig()
},
}
func init() { rootCmd.AddCommand(breakCmd) }