mirror of
https://github.com/packwiz/packwiz.git
synced 2025-04-27 16:46: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"
|
"github.com/spf13/cobra"
|
||||||
)
|
)
|
||||||
|
|
||||||
func pinMod(cmd *cobra.Command, args []string, pinned bool) {
|
func pinMod(args []string, pinned bool) {
|
||||||
fmt.Println("Loading modpack...")
|
fmt.Println("Loading modpack...")
|
||||||
pack, err := core.LoadPack()
|
pack, err := core.LoadPack()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -66,21 +66,23 @@ func pinMod(cmd *cobra.Command, args []string, pinned bool) {
|
|||||||
|
|
||||||
// pinCmd represents the pin command
|
// pinCmd represents the pin command
|
||||||
var pinCmd = &cobra.Command{
|
var pinCmd = &cobra.Command{
|
||||||
Use: "pin",
|
Use: "pin",
|
||||||
Short: "Pin a mod to the current version",
|
Short: "Pin a file so it does not get updated automatically",
|
||||||
Args: cobra.ExactArgs(1),
|
Aliases: []string{"hold"},
|
||||||
|
Args: cobra.ExactArgs(1),
|
||||||
Run: func(cmd *cobra.Command, args []string) {
|
Run: func(cmd *cobra.Command, args []string) {
|
||||||
pinMod(cmd, args, true)
|
pinMod(args, true)
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
// unpinCmd represents the unpin command
|
// unpinCmd represents the unpin command
|
||||||
var unpinCmd = &cobra.Command{
|
var unpinCmd = &cobra.Command{
|
||||||
Use: "unpin",
|
Use: "unpin",
|
||||||
Short: "Unpin a mod from the current version",
|
Short: "Unpin a file so it receives updates",
|
||||||
Args: cobra.ExactArgs(1),
|
Aliases: []string{"unhold"},
|
||||||
|
Args: cobra.ExactArgs(1),
|
||||||
Run: func(cmd *cobra.Command, args []string) {
|
Run: func(cmd *cobra.Command, args []string) {
|
||||||
pinMod(cmd, args, false)
|
pinMod(args, false)
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user