Skip to content

Commit 3c61067

Browse files
authored
Merge pull request #348 from carapace-sh/fix/customizations-30153423491
fix: adapt customizations for AWS CLI 2.36.8
2 parents 6878af2 + 49f7d44 commit 3c61067

4 files changed

Lines changed: 57 additions & 3 deletions

File tree

cmd/carapace-aws/cmd/botocore/aws.emr.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,10 @@ commands:
240240
- name: describe-cluster
241241
description: Provides cluster-level details including status, hardware and software configuration, VPC settings, and so on.
242242
flags:
243+
--cli-input-json=: Read arguments from the JSON string provided.
244+
--cli-input-yaml=: Read arguments from the YAML string provided.
243245
--cluster-id=!: The identifier of the cluster to describe.
246+
--generate-cli-skeleton: Prints a JSON skeleton to standard output without sending an API request.
244247
- name: describe-notebook-execution
245248
description: Provides details of a notebook execution.
246249
flags:
@@ -831,11 +834,17 @@ commands:
831834
- name: cluster-running
832835
description: Provides cluster-level details including status, hardware and software configuration, VPC settings, and so on.
833836
flags:
837+
--cli-input-json=: Read arguments from the JSON string provided.
838+
--cli-input-yaml=: Read arguments from the YAML string provided.
834839
--cluster-id=!: The identifier of the cluster to describe.
840+
--generate-cli-skeleton: Prints a JSON skeleton to standard output without sending an API request.
835841
- name: cluster-terminated
836842
description: Provides cluster-level details including status, hardware and software configuration, VPC settings, and so on.
837843
flags:
844+
--cli-input-json=: Read arguments from the JSON string provided.
845+
--cli-input-yaml=: Read arguments from the YAML string provided.
838846
--cluster-id=!: The identifier of the cluster to describe.
847+
--generate-cli-skeleton: Prints a JSON skeleton to standard output without sending an API request.
839848
- name: step-complete
840849
description: Provides more detail about the cluster step.
841850
flags:

cmd/carapace-aws/cmd/botocore/aws.sagemaker.yaml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2488,7 +2488,6 @@ commands:
24882488
--cli-input-yaml=: Read arguments from the YAML string provided.
24892489
--generate-cli-skeleton: Prints a JSON skeleton to standard output without sending an API request.
24902490
--image-name=!: The name of the image.
2491-
--version-number=: The version of the image.
24922491
- name: describe-inference-component
24932492
description: Returns information about an inference component.
24942493
flags:
@@ -6734,7 +6733,6 @@ commands:
67346733
--cli-input-yaml=: Read arguments from the YAML string provided.
67356734
--generate-cli-skeleton: Prints a JSON skeleton to standard output without sending an API request.
67366735
--image-name=!: The name of the image.
6737-
--version-number=: The version of the image.
67386736
- name: image-version-deleted
67396737
description: Describes a version of a SageMaker AI image.
67406738
flags:
@@ -6743,7 +6741,6 @@ commands:
67436741
--cli-input-yaml=: Read arguments from the YAML string provided.
67446742
--generate-cli-skeleton: Prints a JSON skeleton to standard output without sending an API request.
67456743
--image-name=!: The name of the image.
6746-
--version-number=: The version of the image.
67476744
- name: notebook-instance-deleted
67486745
description: Returns information about a notebook instance.
67496746
flags:

cmd/carapace-spec-botocore/cmd/customizations/emr.go

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,31 @@ func init() {
7373
}
7474
cmd.Commands = append(cmd.Commands, specCommand)
7575
}
76+
for i := range cmd.Commands {
77+
if cmd.Commands[i].Name != "wait" {
78+
continue
79+
}
80+
for j := range cmd.Commands[i].Commands {
81+
waitSubCmd := &cmd.Commands[i].Commands[j]
82+
if waitSubCmd.Name != "cluster-running" && waitSubCmd.Name != "cluster-terminated" {
83+
continue
84+
}
85+
waitSubCmd.AddFlag(command.Flag{
86+
Longhand: "cli-input-json",
87+
Description: "Read arguments from the JSON string provided.",
88+
Value: true,
89+
})
90+
waitSubCmd.AddFlag(command.Flag{
91+
Longhand: "cli-input-yaml",
92+
Description: "Read arguments from the YAML string provided.",
93+
Value: true,
94+
})
95+
waitSubCmd.AddFlag(command.Flag{
96+
Longhand: "generate-cli-skeleton",
97+
Description: "Prints a JSON skeleton to standard output without sending an API request.",
98+
})
99+
}
100+
}
76101
return nil
77102
}
78103

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
package customizations
2+
3+
import (
4+
"github.com/carapace-sh/carapace-spec/pkg/command"
5+
)
6+
7+
func init() {
8+
customizations["sagemaker"] = func(cmd *command.Command) error {
9+
for i := range cmd.Commands {
10+
if cmd.Commands[i].Name != "wait" {
11+
continue
12+
}
13+
for j := range cmd.Commands[i].Commands {
14+
waitSubCmd := &cmd.Commands[i].Commands[j]
15+
if waitSubCmd.Name != "image-version-created" && waitSubCmd.Name != "image-version-deleted" {
16+
continue
17+
}
18+
delete(waitSubCmd.Flags, "--version-number=")
19+
}
20+
}
21+
return nil
22+
}
23+
}

0 commit comments

Comments
 (0)