pacman: simply complete files to query file database

This commit is contained in:
rsteube 2025-03-29 09:05:11 +01:00
parent 5a8e7fe144
commit d148d9a504
7 changed files with 15 additions and 2 deletions

View File

@ -15,6 +15,8 @@ var databaseCmd = &cobra.Command{
}
func init() {
carapace.Gen(databaseCmd).Standalone()
databaseCmd.Flags().String("arch", "", "set an alternate architecture")
databaseCmd.Flags().Bool("asdeps", false, "mark packages as non-explicitly installed")
databaseCmd.Flags().Bool("asexplicit", false, "mark packages as explicitly installed")

View File

@ -15,6 +15,8 @@ var deptestCmd = &cobra.Command{
}
func init() {
carapace.Gen(deptestCmd).Standalone()
deptestCmd.Flags().String("arch", "", "set an alternate architecture")
deptestCmd.Flags().String("cachedir", "", "set an alternate package cache location")
deptestCmd.Flags().String("color", "", "colorize the output")

View File

@ -2,7 +2,6 @@ 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"
)
@ -15,6 +14,8 @@ var filesCmd = &cobra.Command{
}
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")
@ -49,6 +50,6 @@ func init() {
})
carapace.Gen(filesCmd).PositionalAnyCompletion(
pacman.ActionPackages().FilterArgs(),
carapace.ActionFiles().Chdir("/"),
)
}

View File

@ -15,6 +15,8 @@ var queryCmd = &cobra.Command{
}
func init() {
carapace.Gen(queryCmd).Standalone()
queryCmd.Flags().String("arch", "", "set an alternate architecture")
queryCmd.Flags().String("cachedir", "", "set an alternate package cache location")
queryCmd.Flags().BoolP("changelog", "c", false, "view the changelog of a package")

View File

@ -15,6 +15,8 @@ var removeCmd = &cobra.Command{
}
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")

View File

@ -15,6 +15,8 @@ var syncCmd = &cobra.Command{
}
func init() {
carapace.Gen(syncCmd).Standalone()
syncCmd.Flags().String("arch", "", "set an alternate architecture")
syncCmd.Flags().Bool("asdeps", false, "install packages as non-explicitly installed")
syncCmd.Flags().Bool("asexplicit", false, "install packages as explicitly installed")

View File

@ -15,6 +15,8 @@ var upgradeCmd = &cobra.Command{
}
func init() {
carapace.Gen(upgradeCmd).Standalone()
upgradeCmd.Flags().String("arch", "", "set an alternate architecture")
upgradeCmd.Flags().Bool("asdeps", false, "install packages as non-explicitly installed")
upgradeCmd.Flags().Bool("asexplicit", false, "install packages as explicitly installed")