forked from twpayne/chezmoi
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathupgradecmd.go
More file actions
32 lines (27 loc) · 730 Bytes
/
upgradecmd.go
File metadata and controls
32 lines (27 loc) · 730 Bytes
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
package cmd
import (
"github.com/spf13/cobra"
)
type upgradeCmdConfig struct {
method string
owner string
repo string
}
func (c *Config) newUpgradeCmd() *cobra.Command {
upgradeCmd := &cobra.Command{
Use: "upgrade",
Short: "Upgrade chezmoi to the latest released version",
Long: mustLongHelp("upgrade"),
Example: example("upgrade"),
Args: cobra.NoArgs,
RunE: c.runUpgradeCmd,
Annotations: map[string]string{
runsCommands: "true",
},
}
flags := upgradeCmd.Flags()
flags.StringVar(&c.upgrade.method, "method", "", "set method")
flags.StringVar(&c.upgrade.owner, "owner", "twpayne", "set owner")
flags.StringVar(&c.upgrade.repo, "repo", "chezmoi", "set repo")
return upgradeCmd
}