Skip to content

Commit

Permalink
feat(cli): Add examples to --help output for "set APPNAME" (argoproj#…
Browse files Browse the repository at this point in the history
…15872)

* feat: Add examples to --help output for get APPNAME

Signed-off-by: Ratan Gulati <ratangulati.dev@gmail.com>

* feat: Add examples to --help output for get APPNAME

Signed-off-by: Ratan Gulati <ratangulati.dev@gmail.com>

---------

Signed-off-by: Ratan Gulati <ratangulati.dev@gmail.com>
  • Loading branch information
Ratangulati authored and lukaszgyg committed Jan 12, 2024
1 parent 1b8cb6a commit 6fa4c10
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
17 changes: 17 additions & 0 deletions cmd/argocd/commands/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -687,6 +687,23 @@ func NewApplicationSetCommand(clientOpts *argocdclient.ClientOptions) *cobra.Com
var command = &cobra.Command{
Use: "set APPNAME",
Short: "Set application parameters",
Example: templates.Examples(`
# Set application parameters for the application "my-app"
argocd app set my-app --parameter key1=value1 --parameter key2=value2
# Set and validate application parameters for "my-app"
argocd app set my-app --parameter key1=value1 --parameter key2=value2 --validate
# Set and override application parameters with JSON or YAML file
argocd app set my-app --from-file path/to/parameters.json
# Set and override application parameters with a parameter file
argocd app set my-app --parameter-file path/to/parameter-file.yaml
# Set application parameters and specify the namespace
argocd app set my-app --parameter key1=value1 --parameter key2=value2 --namespace my-namespace
`),

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

Expand Down
19 changes: 19 additions & 0 deletions docs/user-guide/commands/argocd_app_set.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,25 @@ Set application parameters
argocd app set APPNAME [flags]
```

### Examples

```
# Set application parameters for the application "my-app"
argocd app set my-app --parameter key1=value1 --parameter key2=value2
# Set and validate application parameters for "my-app"
argocd app set my-app --parameter key1=value1 --parameter key2=value2 --validate
# Set and override application parameters with JSON or YAML file
argocd app set my-app --from-file path/to/parameters.json
# Set and override application parameters with a parameter file
argocd app set my-app --parameter-file path/to/parameter-file.yaml
# Set application parameters and specify the namespace
argocd app set my-app --parameter key1=value1 --parameter key2=value2 --namespace my-namespace
```

### Options

```
Expand Down

0 comments on commit 6fa4c10

Please sign in to comment.