-
-
Notifications
You must be signed in to change notification settings - Fork 43
/
remove.go
62 lines (56 loc) · 3.13 KB
/
remove.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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
package cmd
import (
"github.com/carapace-sh/carapace"
"github.com/carapace-sh/carapace-bin/pkg/actions/tools/pacman"
"github.com/carapace-sh/carapace/pkg/style"
"github.com/spf13/cobra"
)
var removeCmd = &cobra.Command{
Use: "remove",
Aliases: []string{"R"},
Short: "Remove packages from the system",
Run: func(cmd *cobra.Command, args []string) {},
}
func init() {
carapace.Gen(removeCmd).Standalone()
removeCmd.Flags().String("arch", "", "set an alternate architecture")
removeCmd.Flags().String("assume-installed", "", "add a virtual package to satisfy dependencies")
removeCmd.Flags().String("cachedir", "", "set an alternate package cache location")
removeCmd.Flags().BoolP("cascade", "c", false, "remove packages and all packages that depend on them")
removeCmd.Flags().String("color", "", "colorize the output")
removeCmd.Flags().String("config", "", "set an alternate configuration file")
removeCmd.Flags().Bool("confirm", false, "always ask for confirmation")
removeCmd.Flags().Bool("dbonly", false, "only modify database entries, not package files")
removeCmd.Flags().StringP("dbpath", "b", "", "set an alternate database location")
removeCmd.Flags().Bool("debug", false, "display debug messages")
removeCmd.Flags().Bool("disable-download-timeout", false, "use relaxed timeouts for download")
removeCmd.Flags().String("gpgdir", "", "set an alternate home directory for GnuPG")
removeCmd.Flags().String("hookdir", "", "set an alternate hook location")
removeCmd.Flags().String("logfile", "", "set an alternate log file")
removeCmd.Flags().Bool("noconfirm", false, "do not ask for any confirmation")
removeCmd.Flags().CountP("nodeps", "d", "skip dependency version checks (-dd to skip all checks)")
removeCmd.Flags().Bool("noprogressbar", false, "do not show a progress bar when downloading files")
removeCmd.Flags().BoolP("nosave", "n", false, "remove configuration files")
removeCmd.Flags().Bool("noscriptlet", false, "do not execute the install scriptlet if one exists")
removeCmd.Flags().BoolP("print", "p", false, "print the targets instead of performing the operation")
removeCmd.Flags().String("print-format", "", "specify how the targets should be printed")
removeCmd.Flags().CountP("recursive", "s", "remove unnecessary dependencies")
removeCmd.Flags().StringP("root", "r", "", "set an alternate installation root")
removeCmd.Flags().Bool("sysroot", false, "operate on a mounted guest system (root-only)")
removeCmd.Flags().BoolP("unneeded", "u", false, "remove unneeded packages")
removeCmd.Flags().BoolP("verbose", "v", false, "be verbose")
carapace.Gen(removeCmd).FlagCompletion(carapace.ActionMap{
"arch": carapace.ActionValues("i686", "x86_64"),
"cachedir": carapace.ActionDirectories(),
"color": carapace.ActionValues("auto", "never", "always").StyleF(style.ForKeyword),
"config": carapace.ActionFiles(),
"dbpath": carapace.ActionFiles(),
"gpgdir": carapace.ActionDirectories(),
"hookdir": carapace.ActionDirectories(),
"logfile": carapace.ActionFiles(),
"root": carapace.ActionDirectories(),
})
carapace.Gen(removeCmd).PositionalAnyCompletion(
pacman.ActionPackages().FilterArgs(),
)
}