Skip to content

Commit

Permalink
Merge pull request #2055 from rsteube/add-pacman-key
Browse files Browse the repository at this point in the history
added pacman-key
  • Loading branch information
rsteube authored Dec 6, 2023
2 parents 5ff2d9e + 0b17379 commit a845664
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 0 deletions.
49 changes: 49 additions & 0 deletions completers/pacman-key_completer/cmd/root.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
package cmd

import (
"github.com/rsteube/carapace"
"github.com/spf13/cobra"
)

var rootCmd = &cobra.Command{
Use: "pacman-key",
Short: "Manage pacman's list of trusted keys",
Long: "https://archlinux.org/pacman/pacman-key.8.html",
Run: func(cmd *cobra.Command, args []string) {},
}

func Execute() error {
return rootCmd.Execute()
}
func init() {
carapace.Gen(rootCmd).Standalone()

rootCmd.Flags().BoolP("add", "a", false, "Add the specified keys (empty for stdin)")
rootCmd.Flags().String("config", "", "Use an alternate config file")
rootCmd.Flags().BoolP("delete", "d", false, "Remove the specified keyids")
rootCmd.Flags().Bool("edit-key", false, "Present a menu for key management task on keyids")
rootCmd.Flags().BoolP("export", "e", false, "Export the specified or all keyids")
rootCmd.Flags().BoolP("finger", "f", false, "List fingerprint for specified or all keyids")
rootCmd.Flags().String("gpgdir", "", "Set an alternate directory for GnuPG")
rootCmd.Flags().BoolP("help", "h", false, "Show this help message and exit")
rootCmd.Flags().Bool("import", false, "Imports pubring.gpg from dir(s)")
rootCmd.Flags().Bool("import-trustdb", false, "Imports ownertrust values from trustdb.gpg in dir(s)")
rootCmd.Flags().Bool("init", false, "Ensure the keyring is properly initialized")
rootCmd.Flags().String("keyserver", "", "Specify a keyserver to use if necessary")
rootCmd.Flags().BoolP("list-keys", "l", false, "List the specified or all keys")
rootCmd.Flags().Bool("list-sigs", false, "List keys and their signatures")
rootCmd.Flags().Bool("lsign-key", false, "Locally sign the specified keyid")
rootCmd.Flags().Bool("populate", false, "Reload the default keys from the (given) keyrings in '/usr/share/pacman/keyrings'")
rootCmd.Flags().BoolP("recv-keys", "r", false, "Fetch the specified keyids")
rootCmd.Flags().Bool("refresh-keys", false, "Update specified or all keys from a keyserver")
rootCmd.Flags().BoolP("updatedb", "u", false, "Update the trustdb of pacman")
rootCmd.Flags().Bool("verbose", false, "Show extra information")
rootCmd.Flags().BoolP("verify", "v", false, "Verify the file(s) specified by the signature(s)")
rootCmd.Flags().BoolP("version", "V", false, "Show program version")

carapace.Gen(rootCmd).FlagCompletion(carapace.ActionMap{
"config": carapace.ActionFiles(),
"gpgdir": carapace.ActionDirectories(),
"keyserver": carapace.ActionValues(), // TODO
})
}
7 changes: 7 additions & 0 deletions completers/pacman-key_completer/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package main

import "github.com/rsteube/carapace-bin/completers/pacman-key_completer/cmd"

func main() {
cmd.Execute()
}

0 comments on commit a845664

Please sign in to comment.