Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add examples to --help output for "gpg_list" #16017

Merged
merged 2 commits into from
Oct 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions cmd/argocd/commands/gpg.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import (
appsv1 "github.com/argoproj/argo-cd/v2/pkg/apis/application/v1alpha1"
"github.com/argoproj/argo-cd/v2/util/errors"
argoio "github.com/argoproj/argo-cd/v2/util/io"
"github.com/argoproj/argo-cd/v2/util/templates"
)

// NewGPGCommand returns a new instance of an `argocd repo` command
Expand Down Expand Up @@ -42,6 +43,17 @@ func NewGPGListCommand(clientOpts *argocdclient.ClientOptions) *cobra.Command {
var command = &cobra.Command{
Use: "list",
Short: "List configured GPG public keys",
Example: templates.Examples(`
# List all configured GPG public keys in wide format (default).
argocd gpg list

# List all configured GPG public keys in JSON format.
argocd gpg list -o json

# List all configured GPG public keys in YAML format.
argocd gpg list -o yaml
`),

Run: func(c *cobra.Command, args []string) {
ctx := c.Context()

Expand Down
13 changes: 13 additions & 0 deletions docs/user-guide/commands/argocd_gpg_list.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,19 @@ List configured GPG public keys
argocd gpg list [flags]
```

### Examples

```
# List all configured GPG public keys in wide format (default).
argocd gpg list

# List all configured GPG public keys in JSON format.
argocd gpg list -o json

# List all configured GPG public keys in YAML format.
argocd gpg list -o yaml
```

### Options

```
Expand Down
Loading