Skip to content

Commit

Permalink
feat(cli): Add examples to --help output for "gpg add" (argoproj#16020)
Browse files Browse the repository at this point in the history
* feat: Add examples to --help output for gpg add

Signed-off-by: Ratan Gulati <[email protected]>

* Update gpg.go

Signed-off-by: Ratan Gulati <[email protected]>

* feat: Add examples to --help output for gpg add

Signed-off-by: Ratan Gulati <[email protected]>

* updated file

Signed-off-by: Ratan Gulati <[email protected]>

---------

Signed-off-by: Ratan Gulati <[email protected]>
  • Loading branch information
Ratangulati authored and tesla59 committed Dec 16, 2023
1 parent 073a584 commit cc6eee9
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
6 changes: 6 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 @@ -109,6 +110,11 @@ func NewGPGAddCommand(clientOpts *argocdclient.ClientOptions) *cobra.Command {
var command = &cobra.Command{
Use: "add",
Short: "Adds a GPG public key to the server's keyring",
Example: templates.Examples(`
# Add a GPG public key to the server's keyring from a file.
argocd gpg add --from /path/to/keyfile
`),

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

Expand Down
7 changes: 7 additions & 0 deletions docs/user-guide/commands/argocd_gpg_add.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,13 @@ Adds a GPG public key to the server's keyring
argocd gpg add [flags]
```

### Examples

```
# Add a GPG public key to the server's keyring from a file.
argocd gpg add --from /path/to/keyfile
```

### Options

```
Expand Down

0 comments on commit cc6eee9

Please sign in to comment.