-
-
Notifications
You must be signed in to change notification settings - Fork 43
/
files.go
55 lines (49 loc) · 2.46 KB
/
files.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
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 filesCmd = &cobra.Command{
Use: "files",
Aliases: []string{"F"},
Short: "Query the files database",
Run: func(cmd *cobra.Command, args []string) {},
}
func init() {
carapace.Gen(filesCmd).Standalone()
filesCmd.Flags().String("arch", "", "set an alternate architecture")
filesCmd.Flags().String("cachedir", "", "set an alternate package cache location")
filesCmd.Flags().String("color", "", "colorize the output")
filesCmd.Flags().String("config", "", "set an alternate configuration file")
filesCmd.Flags().Bool("confirm", false, "always ask for confirmation")
filesCmd.Flags().StringP("dbpath", "b", "", "set an alternate database location")
filesCmd.Flags().Bool("debug", false, "display debug messages")
filesCmd.Flags().Bool("disable-download-timeout", false, "use relaxed timeouts for download")
filesCmd.Flags().String("gpgdir", "", "set an alternate home directory for GnuPG")
filesCmd.Flags().String("hookdir", "", "set an alternate hook location")
filesCmd.Flags().BoolP("list", "l", false, "list the files owned by the queried package")
filesCmd.Flags().String("logfile", "", "set an alternate log file")
filesCmd.Flags().Bool("machinereadable", false, "produce machine-readable output")
filesCmd.Flags().Bool("noconfirm", false, "do not ask for any confirmation")
filesCmd.Flags().BoolP("quiet", "q", false, "show less information for query and search")
filesCmd.Flags().CountP("refresh", "y", "download fresh package databases from the server")
filesCmd.Flags().StringP("root", "r", "", "set an alternate installation root")
filesCmd.Flags().Bool("sysroot", false, "operate on a mounted guest system (root-only)")
filesCmd.Flags().BoolP("verbose", "v", false, "be verbose")
carapace.Gen(filesCmd).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(filesCmd).PositionalAnyCompletion(
pacman.ActionPackages().FilterArgs(),
)
}