/* Copyright © 2023 Brian Buller */ 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) { length := viper.GetDuration("breaklength") viper.Set("lastbreak", time.Now().Add(length)) viper.WriteConfig() }, } func init() { rootCmd.AddCommand(breakCmd) }