Skip to content

Commit d301c07

Browse files
authored
Merge pull request #351 from carapace-sh/fix-boto
fix botocore
2 parents 9d7fb8e + 8517062 commit d301c07

3 files changed

Lines changed: 15 additions & 8 deletions

File tree

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

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -240,10 +240,7 @@ 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.
245243
--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.
247244
- name: describe-notebook-execution
248245
description: Provides details of a notebook execution.
249246
flags:

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2505,6 +2505,7 @@ commands:
25052505
--cli-input-yaml=: Read arguments from the YAML string provided.
25062506
--generate-cli-skeleton: Prints a JSON skeleton to standard output without sending an API request.
25072507
--image-name=!: The name of the image.
2508+
--version-number=: The version of the image.
25082509
- name: describe-inference-component
25092510
description: Returns information about an inference component.
25102511
flags:

cmd/carapace-spec-botocore/cmd/root.go

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -446,12 +446,21 @@ func parseService(name, folder string) *command.Command {
446446

447447
for name, waiter := range waiters {
448448
operationName := CamelCaseToDash(waiter.Operation)
449-
for _, command := range cmd.Commands {
450-
if command.Name == operationName {
451-
command.Name = CamelCaseToDash(name)
452-
waitCmd.Commands = append(waitCmd.Commands, command)
453-
break
449+
for i := range cmd.Commands {
450+
if cmd.Commands[i].Name != operationName {
451+
continue
454452
}
453+
waitSub := cmd.Commands[i]
454+
waitSub.Name = CamelCaseToDash(name)
455+
if waitSub.Flags != nil {
456+
flagsCopy := make(command.FlagSet, len(waitSub.Flags))
457+
for k, v := range waitSub.Flags {
458+
flagsCopy[k] = v
459+
}
460+
waitSub.Flags = flagsCopy
461+
}
462+
waitCmd.Commands = append(waitCmd.Commands, waitSub)
463+
break
455464
}
456465
// TODO sort in carapace-spec
457466
slices.SortFunc(waitCmd.Commands, func(a, b command.Command) int { return strings.Compare(a.Name, b.Name) })

0 commit comments

Comments
 (0)