-
-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2055 from rsteube/add-pacman-key
added pacman-key
- Loading branch information
Showing
2 changed files
with
56 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() | ||
} |