Skip to content

Commit

Permalink
Update examples with newer way of setting output format over existing…
Browse files Browse the repository at this point in the history
… one
  • Loading branch information
nikhilsbhat committed Jan 27, 2024
1 parent 3f2999e commit 9083c88
Show file tree
Hide file tree
Showing 15 changed files with 28 additions and 28 deletions.
8 changes: 4 additions & 4 deletions cmd/config_repos.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ func getFailedConfigReposCommand() *cobra.Command {
Use: "get-internal",
Short: `Command to GET all config repo information present in GoCD using internal api [/api/internal/config_repos]
Do not use this command unless you know what you are doing with it`,
Example: "gocd-cli configrepo get-internal --failed --detailed --yaml",
Example: "gocd-cli configrepo get-internal --failed --detailed -o yaml",
Args: cobra.NoArgs,
PreRunE: setCLIClient,
RunE: func(cmd *cobra.Command, args []string) error {
Expand Down Expand Up @@ -202,8 +202,8 @@ func getConfigReposDefinitionsCommand() *cobra.Command {
getConfigReposDefinitionsCmd := &cobra.Command{
Use: "get-definitions",
Short: "Command to GET config-repo definitions present in GoCD [https://api.gocd.org/current/#definitions-defined-in-config-repo]",
Example: `gocd-cli configrepo get-definitions sample-repo --yaml
gocd-cli configrepo get-definitions sample-repo --yaml --pipelines #should print only pipeline names`,
Example: `gocd-cli configrepo get-definitions sample-repo -o yaml
gocd-cli configrepo get-definitions sample-repo -o yaml --pipelines #should print only pipeline names`,
Args: cobra.RangeArgs(1, 1),
PreRunE: setCLIClient,
RunE: func(cmd *cobra.Command, args []string) error {
Expand Down Expand Up @@ -491,7 +491,7 @@ func getConfigRepoPreflightCheckCommand() *cobra.Command {
configTriggerUpdateCommand := &cobra.Command{
Use: "preflight-check",
Short: "Command to PREFLIGHT check the config repo configurations [https://api.gocd.org/current/#preflight-check-of-config-repo-configurations]",
Example: `gocd-cli configrepo preflight-check -f path/to/pipeline1.gocd.yaml -f path/to/pipeline2.gocd.yaml --repo-name helm-images --yaml`,
Example: `gocd-cli configrepo preflight-check -f path/to/pipeline1.gocd.yaml -f path/to/pipeline2.gocd.yaml --repo-name helm-images -o yaml`,
Args: cobra.NoArgs,
PreRunE: setCLIClient,
RunE: func(cmd *cobra.Command, args []string) error {
Expand Down
12 changes: 6 additions & 6 deletions cmd/environments.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@ func getEnvironmentsCommand() *cobra.Command {
getEnvironmentsCmd := &cobra.Command{
Use: "get-all",
Short: "Command to GET all the environments present in GoCD [https://api.gocd.org/current/#get-all-environments]",
Example: `gocd-cli environment get-all --yaml
gocd-cli environment get-all --env-var ENVIRONMENT_VAR_1 --env-var ENVIRONMENT_VAR_2 --yaml
gocd-cli environment get-all --pipelines --yaml`,
Example: `gocd-cli environment get-all -o yaml
gocd-cli environment get-all --env-var ENVIRONMENT_VAR_1 --env-var ENVIRONMENT_VAR_2 -o yaml
gocd-cli environment get-all --pipelines -o yaml`,
Args: cobra.NoArgs,
PreRunE: setCLIClient,
RunE: func(cmd *cobra.Command, args []string) error {
Expand Down Expand Up @@ -119,8 +119,8 @@ func getEnvironmentCommand() *cobra.Command {
Use: "get",
Short: "Command to GET a specific environments present in GoCD [https://api.gocd.org/current/#get-environment-config]",
Example: `gocd-cli environment get gocd_environment_1
gocd-cli environment get gocd_environment_1 --env-var ENVIRONMENT_VAR_1 --env-var ENVIRONMENT_VAR_2 --yaml
gocd-cli environment get gocd_environment_1 --pipelines --yaml`,
gocd-cli environment get gocd_environment_1 --env-var ENVIRONMENT_VAR_1 --env-var ENVIRONMENT_VAR_2 -o yaml
gocd-cli environment get gocd_environment_1 --pipelines -o yaml`,
Args: cobra.RangeArgs(1, 1),
PreRunE: setCLIClient,
RunE: func(cmd *cobra.Command, args []string) error {
Expand Down Expand Up @@ -343,7 +343,7 @@ func listEnvironmentsCommand() *cobra.Command {
listEnvironmentsCmd := &cobra.Command{
Use: "list",
Short: "Command to LIST all the environments present in GoCD [https://api.gocd.org/current/#get-all-environments]",
Example: `gocd-cli environment list --yaml`,
Example: `gocd-cli environment list -o yaml`,
Args: cobra.NoArgs,
PreRunE: setCLIClient,
RunE: func(cmd *cobra.Command, args []string) error {
Expand Down
2 changes: 1 addition & 1 deletion cmd/materials.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ func listMaterialsCommand() *cobra.Command {
getMaterialsCmd := &cobra.Command{
Use: "list",
Short: "Command to LIST all materials present in GoCD [https://api.gocd.org/current/#get-all-materials]",
Example: "gocd-cli materials list --yaml (only lists materials that has name or URL)",
Example: "gocd-cli materials list -o yaml (only lists materials that has name or URL)",
Args: cobra.NoArgs,
PreRunE: setCLIClient,
RunE: func(cmd *cobra.Command, args []string) error {
Expand Down
2 changes: 1 addition & 1 deletion cmd/pipeline_groups.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ func getPipelineGroupCommand() *cobra.Command {
Short: "Command to GET a specific pipeline group present in GoCD [https://api.gocd.org/current/#get-a-pipeline-group]",
Args: cobra.RangeArgs(1, 1),
PreRunE: setCLIClient,
Example: `gocd-cli pipeline-group get movies --query "pipelines.[*] | name" --yaml
Example: `gocd-cli pipeline-group get movies --query "pipelines.[*] | name" -o yaml
// should return only the list of pipeline names based on the query`,
RunE: func(cmd *cobra.Command, args []string) error {
response, err := client.GetPipelineGroup(args[0])
Expand Down
4 changes: 2 additions & 2 deletions cmd/pipelines.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ func getPipelineVSMCommand() *cobra.Command {
Short: "Command to GET downstream pipelines of a specified pipeline present in GoCD [https://api.gocd.org/current/#get-pipeline-config]",
Args: cobra.NoArgs,
PreRunE: setCLIClient,
Example: `gocd-cli pipeline vsm --pipeline animation-movies --pipeline animation-and-action-movies --down-stream --instance animation-movies=14 --yaml"`,
Example: `gocd-cli pipeline vsm --pipeline animation-movies --pipeline animation-and-action-movies --down-stream --instance animation-movies=14 -o yaml"`,
RunE: func(cmd *cobra.Command, args []string) error {
vsms := make([]PipelineVSM, 0)

Expand Down Expand Up @@ -1006,7 +1006,7 @@ func getPipelineMapping() *cobra.Command {
getPipelineMappingCmd := &cobra.Command{
Use: "get-mappings",
Short: "Command to Identify the given pipeline is part of which config-repo/environment of GoCD",
Example: "gocd-cli pipeline get-mappings --pipeline helm-images --yaml",
Example: "gocd-cli pipeline get-mappings --pipeline helm-images -o yaml",
Args: cobra.NoArgs,
PreRunE: setCLIClient,
RunE: func(cmd *cobra.Command, args []string) error {
Expand Down
4 changes: 2 additions & 2 deletions docs/doc/gocd-cli_configrepo_get-definitions.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ gocd-cli configrepo get-definitions [flags]
### Examples

```
gocd-cli configrepo get-definitions sample-repo --yaml
gocd-cli configrepo get-definitions sample-repo --yaml --pipelines #should print only pipeline names
gocd-cli configrepo get-definitions sample-repo -o yaml
gocd-cli configrepo get-definitions sample-repo -o yaml --pipelines #should print only pipeline names
```

### Options
Expand Down
2 changes: 1 addition & 1 deletion docs/doc/gocd-cli_configrepo_get-internal.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ gocd-cli configrepo get-internal [flags]
### Examples

```
gocd-cli configrepo get-internal --failed --detailed --yaml
gocd-cli configrepo get-internal --failed --detailed -o yaml
```

### Options
Expand Down
2 changes: 1 addition & 1 deletion docs/doc/gocd-cli_configrepo_preflight-check.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ gocd-cli configrepo preflight-check [flags]
### Examples

```
gocd-cli configrepo preflight-check -f path/to/pipeline1.gocd.yaml -f path/to/pipeline2.gocd.yaml --repo-name helm-images --yaml
gocd-cli configrepo preflight-check -f path/to/pipeline1.gocd.yaml -f path/to/pipeline2.gocd.yaml --repo-name helm-images -o yaml
```

### Options
Expand Down
6 changes: 3 additions & 3 deletions docs/doc/gocd-cli_environment_get-all.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ gocd-cli environment get-all [flags]
### Examples

```
gocd-cli environment get-all --yaml
gocd-cli environment get-all --env-var ENVIRONMENT_VAR_1 --env-var ENVIRONMENT_VAR_2 --yaml
gocd-cli environment get-all --pipelines --yaml
gocd-cli environment get-all -o yaml
gocd-cli environment get-all --env-var ENVIRONMENT_VAR_1 --env-var ENVIRONMENT_VAR_2 -o yaml
gocd-cli environment get-all --pipelines -o yaml
```

### Options
Expand Down
4 changes: 2 additions & 2 deletions docs/doc/gocd-cli_environment_get.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ gocd-cli environment get [flags]

```
gocd-cli environment get gocd_environment_1
gocd-cli environment get gocd_environment_1 --env-var ENVIRONMENT_VAR_1 --env-var ENVIRONMENT_VAR_2 --yaml
gocd-cli environment get gocd_environment_1 --pipelines --yaml
gocd-cli environment get gocd_environment_1 --env-var ENVIRONMENT_VAR_1 --env-var ENVIRONMENT_VAR_2 -o yaml
gocd-cli environment get gocd_environment_1 --pipelines -o yaml
```

### Options
Expand Down
2 changes: 1 addition & 1 deletion docs/doc/gocd-cli_environment_list.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ gocd-cli environment list [flags]
### Examples

```
gocd-cli environment list --yaml
gocd-cli environment list -o yaml
```

### Options
Expand Down
2 changes: 1 addition & 1 deletion docs/doc/gocd-cli_materials_list.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ gocd-cli materials list [flags]
### Examples

```
gocd-cli materials list --yaml (only lists materials that has name or URL)
gocd-cli materials list -o yaml (only lists materials that has name or URL)
```

### Options
Expand Down
2 changes: 1 addition & 1 deletion docs/doc/gocd-cli_pipeline-group_get.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ gocd-cli pipeline-group get [flags]
### Examples

```
gocd-cli pipeline-group get movies --query "pipelines.[*] | name" --yaml
gocd-cli pipeline-group get movies --query "pipelines.[*] | name" -o yaml
// should return only the list of pipeline names based on the query
```

Expand Down
2 changes: 1 addition & 1 deletion docs/doc/gocd-cli_pipeline_get-mappings.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ gocd-cli pipeline get-mappings [flags]
### Examples

```
gocd-cli pipeline get-mappings --pipeline helm-images --yaml
gocd-cli pipeline get-mappings --pipeline helm-images -o yaml
```

### Options
Expand Down
2 changes: 1 addition & 1 deletion docs/doc/gocd-cli_pipeline_vsm.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ gocd-cli pipeline vsm [flags]
### Examples

```
gocd-cli pipeline vsm --pipeline animation-movies --pipeline animation-and-action-movies --down-stream --instance animation-movies=14 --yaml"
gocd-cli pipeline vsm --pipeline animation-movies --pipeline animation-and-action-movies --down-stream --instance animation-movies=14 -o yaml"
```

### Options
Expand Down

0 comments on commit 9083c88

Please sign in to comment.