Skip to content

Commit f58502d

Browse files
committed
tmp
1 parent 6f906f3 commit f58502d

1 file changed

Lines changed: 13 additions & 9 deletions

File tree

cmd/carapace-aws/cmd/botocore/botocore.go

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package botocore
22

33
import (
44
"embed"
5+
"regexp"
56

67
spec "github.com/carapace-sh/carapace-spec"
78
"gopkg.in/yaml.v3"
@@ -444,15 +445,18 @@ func Services() map[string]string {
444445
}
445446

446447
func Operations(service string) map[string]string {
447-
return map[string]map[string]string{
448-
"ec2": {
449-
"accept-address-transfer": "Accepts an Elastic IP address transfer.",
450-
"accept-capacity-reservation-billing-ownership": "Accepts a request to assign billing of the available capacity of a shared Capacity Reservation to your account.",
451-
},
452-
"entityresolution": {
453-
"generate-match-id": "TODO",
454-
},
455-
}[service]
448+
entries, _ := f.ReadDir(".")
449+
r := regexp.MustCompile(`^aws\.(?P<service>[^.]+)\.(?P<operation>[^.]+)\.yaml$`)
450+
451+
operations := make(map[string]string)
452+
for _, entry := range entries {
453+
if matches := r.FindStringSubmatch(entry.Name()); matches != nil {
454+
if matches[1] == service {
455+
operations[matches[2]] = "TODO"
456+
}
457+
}
458+
}
459+
return operations
456460
}
457461

458462
func Get(name string) (*spec.Command, error) {

0 commit comments

Comments
 (0)