/
patch.go
33 lines (24 loc) · 883 Bytes
/
patch.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
package cmd
import (
"github.com/Masterminds/semver"
"github.com/spf13/cobra"
)
var clear bool
// patchCmd represents the patch command
var patchCmd = &cobra.Command{
Use: "patch",
Short: "Bump the patch level",
Long: `Bump the patch level`,
Run: bumpRepoWithBumper(semver.Version.IncPatch),
}
func init() {
rootCmd.AddCommand(patchCmd)
// Here you will define your flags and configuration settings.
// Cobra supports Persistent Flags which will work for this command
// and all subcommands, e.g.:
// patchCmd.PersistentFlags().String("foo", "", "A help for foo")
// Cobra supports local flags which will only run when this command
// is called directly, e.g.:
// patchCmd.Flags().BoolP("toggle", "t", false, "Help message for toggle")
patchCmd.Flags().BoolVarP(&clear, "clear", "c", false, "Force clearing release and meta before incrementing version")
}