mirror of
https://github.com/packwiz/packwiz.git
synced 2025-04-19 13:06:30 +02:00
Add hold/unhold aliases, tweak help msg, remove unused param
This commit is contained in:
parent
dffdbc9b80
commit
e8c28ae57e
20
cmd/pin.go
20
cmd/pin.go
@ -8,7 +8,7 @@ import (
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
func pinMod(cmd *cobra.Command, args []string, pinned bool) {
|
||||
func pinMod(args []string, pinned bool) {
|
||||
fmt.Println("Loading modpack...")
|
||||
pack, err := core.LoadPack()
|
||||
if err != nil {
|
||||
@ -66,21 +66,23 @@ func pinMod(cmd *cobra.Command, args []string, pinned bool) {
|
||||
|
||||
// pinCmd represents the pin command
|
||||
var pinCmd = &cobra.Command{
|
||||
Use: "pin",
|
||||
Short: "Pin a mod to the current version",
|
||||
Args: cobra.ExactArgs(1),
|
||||
Use: "pin",
|
||||
Short: "Pin a file so it does not get updated automatically",
|
||||
Aliases: []string{"hold"},
|
||||
Args: cobra.ExactArgs(1),
|
||||
Run: func(cmd *cobra.Command, args []string) {
|
||||
pinMod(cmd, args, true)
|
||||
pinMod(args, true)
|
||||
},
|
||||
}
|
||||
|
||||
// unpinCmd represents the unpin command
|
||||
var unpinCmd = &cobra.Command{
|
||||
Use: "unpin",
|
||||
Short: "Unpin a mod from the current version",
|
||||
Args: cobra.ExactArgs(1),
|
||||
Use: "unpin",
|
||||
Short: "Unpin a file so it receives updates",
|
||||
Aliases: []string{"unhold"},
|
||||
Args: cobra.ExactArgs(1),
|
||||
Run: func(cmd *cobra.Command, args []string) {
|
||||
pinMod(cmd, args, false)
|
||||
pinMod(args, false)
|
||||
},
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user