Skip to content

Commit

Permalink
feat(cli): Add example to --help output 1 (argoproj#15782)
Browse files Browse the repository at this point in the history
* re-sign commit with DCO

Signed-off-by: Dao Thanh Tung <ttdao.2015@accountancy.smu.edu.sg>

* Update doc file

Signed-off-by: Dao Thanh Tung <ttdao.2015@accountancy.smu.edu.sg>

---------

Signed-off-by: Dao Thanh Tung <ttdao.2015@accountancy.smu.edu.sg>
  • Loading branch information
dttung2905 authored and lukaszgyg committed Jan 12, 2024
1 parent 2cb6dcd commit cdd5f88
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 3 deletions.
7 changes: 7 additions & 0 deletions cmd/argocd/commands/completion.go
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,13 @@ compdef _argocd argocd
Optionally, also add the following, in case you are getting errors involving compdef & compinit such as command not found: compdef:
autoload -Uz compinit
compinit
`,
Example: `# For bash
$ source <(argocd completion bash)
# For zsh
$ argocd completion zsh > _argocd
$ source _argocd
`,
Run: func(cmd *cobra.Command, args []string) {
if len(args) != 1 {
Expand Down
4 changes: 4 additions & 0 deletions cmd/argocd/commands/logout.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ func NewLogoutCommand(globalClientOpts *argocdclient.ClientOptions) *cobra.Comma
Use: "logout CONTEXT",
Short: "Log out from Argo CD",
Long: "Log out from Argo CD",
Example: `# To log out of argocd
$ argocd logout
# This can be helpful for security reasons or when you want to switch between different Argo CD contexts or accounts.
`,
Run: func(c *cobra.Command, args []string) {
if len(args) == 0 {
c.HelpFunc()(c, args)
Expand Down
7 changes: 4 additions & 3 deletions cmd/argocd/commands/relogin.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,10 @@ func NewReloginCommand(globalClientOpts *argocdclient.ClientOptions) *cobra.Comm
ssoPort int
)
var command = &cobra.Command{
Use: "relogin",
Short: "Refresh an expired authenticate token",
Long: "Refresh an expired authenticate token",
Use: "relogin",
Short: "Refresh an expired authenticate token",
Long: "Refresh an expired authenticate token",
Example: "argocd relogin --password YOUR_PASSWORD",
Run: func(c *cobra.Command, args []string) {
ctx := c.Context()

Expand Down
12 changes: 12 additions & 0 deletions docs/user-guide/commands/argocd_completion.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,18 @@ compinit
argocd completion SHELL [flags]
```

### Examples

```
# For bash
$ source <(argocd completion bash)
# For zsh
$ argocd completion zsh > _argocd
$ source _argocd
```

### Options

```
Expand Down
9 changes: 9 additions & 0 deletions docs/user-guide/commands/argocd_logout.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,15 @@ Log out from Argo CD
argocd logout CONTEXT [flags]
```

### Examples

```
# To log out of argocd
$ argocd logout
# This can be helpful for security reasons or when you want to switch between different Argo CD contexts or accounts.
```

### Options

```
Expand Down
6 changes: 6 additions & 0 deletions docs/user-guide/commands/argocd_relogin.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@ Refresh an expired authenticate token
argocd relogin [flags]
```

### Examples

```
argocd relogin --password YOUR_PASSWORD
```

### Options

```
Expand Down

0 comments on commit cdd5f88

Please sign in to comment.