Skip to content

Commit

Permalink
feat: Add examples to --help output for remaining "argocd account"
Browse files Browse the repository at this point in the history
Signed-off-by: Michele Caci <michele.caci@gmail.com>
  • Loading branch information
mcaci committed Oct 4, 2023
1 parent 43fe01a commit c0b4019
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 0 deletions.
21 changes: 21 additions & 0 deletions cmd/argocd/commands/account.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,26 @@ import (
"github.com/argoproj/argo-cd/v2/util/io"
"github.com/argoproj/argo-cd/v2/util/localconfig"
sessionutil "github.com/argoproj/argo-cd/v2/util/session"
"github.com/argoproj/argo-cd/v2/util/templates"
)

func NewAccountCommand(clientOpts *argocdclient.ClientOptions) *cobra.Command {
var command = &cobra.Command{
Use: "account",
Short: "Manage account settings",
Example: templates.Examples(`
# List accounts
argocd account list
# Update the current user's password
argocd account update-password
# Can I sync any app?
argocd account can-i sync applications '*'
# Get User information
argocd account get-user-info
`),
Run: func(c *cobra.Command, args []string) {
c.HelpFunc()(c, args)
os.Exit(1)
Expand Down Expand Up @@ -143,6 +157,13 @@ func NewAccountGetUserInfoCommand(clientOpts *argocdclient.ClientOptions) *cobra
var command = &cobra.Command{
Use: "get-user-info",
Short: "Get user info",
Example: templates.Examples(`
# Get User information
argocd account get-user-info
# Get User information in yaml format
argocd account get-user-info -o yaml
`),
Run: func(c *cobra.Command, args []string) {
ctx := c.Context()

Expand Down
16 changes: 16 additions & 0 deletions docs/user-guide/commands/argocd_account.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,22 @@ Manage account settings
argocd account [flags]
```

### Examples

```
# List accounts
argocd account list
# Update the current user's password
argocd account update-password
# Can I sync any app?
argocd account can-i sync applications '*'
# Get User information
argocd account get-user-info
```

### Options

```
Expand Down
10 changes: 10 additions & 0 deletions docs/user-guide/commands/argocd_account_get-user-info.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,16 @@ Get user info
argocd account get-user-info [flags]
```

### Examples

```
# Get User information
argocd account get-user-info
# Get User information in yaml format
argocd account get-user-info -o yaml
```

### Options

```
Expand Down

0 comments on commit c0b4019

Please sign in to comment.