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(cli): Added example to --help output for context #15809

Merged
merged 10 commits into from
Oct 5, 2023
8 changes: 8 additions & 0 deletions cmd/argocd/commands/context.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,14 @@ func NewContextCommand(clientOpts *argocdclient.ClientOptions) *cobra.Command {
Use: "context [CONTEXT]",
Aliases: []string{"ctx"},
Short: "Switch between contexts",
Example: `# List Argo CD Contexts
argocd context

# Switch Argo CD context
argocd context cd.argoproj.io

# Delete Argo CD context
argocd context cd.argoproj.io --delete`,
Run: func(c *cobra.Command, args []string) {

localCfg, err := localconfig.ReadLocalConfig(clientOpts.ConfigPath)
Expand Down
13 changes: 13 additions & 0 deletions docs/user-guide/commands/argocd_context.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,19 @@ Switch between contexts
argocd context [CONTEXT] [flags]
```

### Examples

```
# List Argo CD Contexts
argocd context

# Switch Argo CD context
argocd context cd.argoproj.io

# Delete Argo CD context
argocd context cd.argoproj.io --delete
```

### Options

```
Expand Down