Skip to content

Commit

Permalink
added conda-content-trust
Browse files Browse the repository at this point in the history
  • Loading branch information
rsteube committed Mar 2, 2023
1 parent d6e9f1c commit 0a5522d
Show file tree
Hide file tree
Showing 8 changed files with 144 additions and 1 deletion.
19 changes: 19 additions & 0 deletions completers/conda-content-trust_completer/cmd/gpgKeyLookup.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package cmd

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

var gpgKeyLookupCmd = &cobra.Command{
Use: "gpg-key-lookup",
Short: "Fetch the actual ed25519 public key value of the underlying key",
Run: func(cmd *cobra.Command, args []string) {},
}

func init() {
carapace.Gen(gpgKeyLookupCmd).Standalone()
gpgKeyLookupCmd.Flags().BoolP("help", "h", false, "show this help message and exit")

rootCmd.AddCommand(gpgKeyLookupCmd)
}
24 changes: 24 additions & 0 deletions completers/conda-content-trust_completer/cmd/gpgSign.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package cmd

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

var gpgSignCmd = &cobra.Command{
Use: "gpg-sign",
Short: "Sign a given piece of metadata usign GPG",
Run: func(cmd *cobra.Command, args []string) {},
}

func init() {
carapace.Gen(gpgSignCmd).Standalone()

gpgSignCmd.Flags().BoolP("help", "h", false, "show this help message and exit")
rootCmd.AddCommand(gpgSignCmd)

carapace.Gen(gpgSignCmd).PositionalCompletion(
carapace.ActionValues(),
carapace.ActionFiles(),
)
}
23 changes: 23 additions & 0 deletions completers/conda-content-trust_completer/cmd/modifyMetadata.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package cmd

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

var modifyMetadataCmd = &cobra.Command{
Use: "modify-metadata",
Short: "Modify metadata file",
Run: func(cmd *cobra.Command, args []string) {},
}

func init() {
carapace.Gen(modifyMetadataCmd).Standalone()

modifyMetadataCmd.Flags().BoolP("help", "h", false, "show this help message and exit")
rootCmd.AddCommand(modifyMetadataCmd)

carapace.Gen(modifyMetadataCmd).PositionalCompletion(
carapace.ActionFiles(),
)
}
23 changes: 23 additions & 0 deletions completers/conda-content-trust_completer/cmd/root.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package cmd

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

var rootCmd = &cobra.Command{
Use: "conda-content-trust",
Short: "Signing and verification tools for Conda",
Long: "https://github.com/conda/conda-content-trust",
Run: func(cmd *cobra.Command, args []string) {},
}

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

rootCmd.Flags().BoolP("help", "h", false, "show this help message and exit")
rootCmd.Flags().BoolP("version", "V", false, "Show the conda-content-trust version number and exit.")
}
23 changes: 23 additions & 0 deletions completers/conda-content-trust_completer/cmd/signArtifacts.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package cmd

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

var signArtifactsCmd = &cobra.Command{
Use: "sign-artifacts",
Short: "Produce artifact signatures and update repodata.json",
Run: func(cmd *cobra.Command, args []string) {},
}

func init() {
carapace.Gen(signArtifactsCmd).Standalone()

signArtifactsCmd.Flags().BoolP("help", "h", false, "show this help message and exit")
rootCmd.AddCommand(signArtifactsCmd)

carapace.Gen(signArtifactsCmd).PositionalCompletion(
carapace.ActionFiles(),
)
}
24 changes: 24 additions & 0 deletions completers/conda-content-trust_completer/cmd/verifyMetadata.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package cmd

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

var verifyMetadataCmd = &cobra.Command{
Use: "verify-metadata",
Short: "Verify metadata file",
Run: func(cmd *cobra.Command, args []string) {},
}

func init() {
carapace.Gen(verifyMetadataCmd).Standalone()

verifyMetadataCmd.Flags().BoolP("help", "h", false, "show this help message and exit")
rootCmd.AddCommand(verifyMetadataCmd)

carapace.Gen(verifyMetadataCmd).PositionalCompletion(
carapace.ActionFiles(),
carapace.ActionFiles(),
)
}
7 changes: 7 additions & 0 deletions completers/conda-content-trust_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/conda-content-trust_completer/cmd"

func main() {
cmd.Execute()
}
2 changes: 1 addition & 1 deletion completers/conda_completer/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ func init() {
func addOtherCommands() {
// hardcoded for now (should check PATH for conda-{COMMAND})
others := map[string]string{
"content-trust": "",
"content-trust": "Signing and verification tools for Conda",
"env": "Manage conda environments",
}
for name, description := range others {
Expand Down

0 comments on commit 0a5522d

Please sign in to comment.