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: Add examples to --help output for remaining "get APPNAME" #15862

Merged
merged 15 commits into from
Oct 18, 2023
30 changes: 30 additions & 0 deletions cmd/argocd/commands/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ import (
"github.com/argoproj/argo-cd/v2/util/grpc"
argoio "github.com/argoproj/argo-cd/v2/util/io"
"github.com/argoproj/argo-cd/v2/util/manifeststream"
"github.com/argoproj/argo-cd/v2/util/templates"
"github.com/argoproj/argo-cd/v2/util/text/label"
)

Expand Down Expand Up @@ -317,6 +318,35 @@ func NewApplicationGetCommand(clientOpts *argocdclient.ClientOptions) *cobra.Com
var command = &cobra.Command{
Use: "get APPNAME",
Short: "Get application details",
Example: templates.Examples(`
# Get basic details about the application "my-app" in wide format
argocd app get my-app -o wide

# Get detailed information about the application "my-app" in YAML format
argocd app get my-app -o yaml

# Get details of the application "my-app" in JSON format
argocd get my-app -o json

# Get application details and include information about the current operation
argocd app get my-app --show-operation

# Show application parameters and overrides
argocd app get my-app --show-params

# Refresh application data when retrieving
argocd app get my-app --refresh

# Perform a hard refresh, including refreshing application data and target manifests cache
argocd app get my-app --hard-refresh

# Get application details and display them in a tree format
argocd app get my-app --output tree

# Get application details and display them in a detailed tree format
argocd app get my-app --output tree=detailed
`),

Run: func(c *cobra.Command, args []string) {
ctx := c.Context()
if len(args) == 0 {
Expand Down
31 changes: 31 additions & 0 deletions docs/user-guide/commands/argocd_app_get.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,37 @@ Get application details
argocd app get APPNAME [flags]
```

### Examples

```
# Get basic details about the application "my-app" in wide format
argocd app get my-app -o wide

# Get detailed information about the application "my-app" in YAML format
argocd app get my-app -o yaml

# Get details of the application "my-app" in JSON format
argocd get my-app -o json

# Get application details and include information about the current operation
argocd app get my-app --show-operation

# Show application parameters and overrides
argocd app get my-app --show-params

# Refresh application data when retrieving
argocd app get my-app --refresh

# Perform a hard refresh, including refreshing application data and target manifests cache
argocd app get my-app --hard-refresh

# Get application details and display them in a tree format
argocd app get my-app --output tree

# Get application details and display them in a detailed tree format
argocd app get my-app --output tree=detailed
```

### Options

```
Expand Down
Loading