Add support for recursive listing (#885)

This commit is contained in:
Jeff Mitchell authored and GitHub committed 2021-01-25 19:37:40 -05:00
1 parent 1f9fcad1cd
commit 6cd97a4a6e
77 files changed
+2244 -1448

No files matched your search

+14 -2
View File
@@ -48,7 +48,7 @@ var flagsMap = map[string][]string{
"update": {"id", "name", "description", "version"},
"read": {"id"},
"delete": {"id"},
"list": {"scope-id"},
"list": {"scope-id", "recursive"},
"add-members": {"id", "member", "version"},
"set-members": {"id", "member", "version"},
"remove-members": {"id", "member", "version"},
@@ -114,7 +114,6 @@ func (c *Command) Run(args []string) int {
default:
opts = append(opts, groups.WithName(c.FlagName))
}
switch c.FlagDescription {
case "":
case "null":
@@ -122,6 +121,10 @@ func (c *Command) Run(args []string) int {
default:
opts = append(opts, groups.WithDescription(c.FlagDescription))
}
switch c.FlagRecursive {
case true:
opts = append(opts, groups.WithRecursive(true))
}
members := c.flagMembers
switch c.Func {
@@ -248,6 +251,15 @@ func (c *Command) Run(args []string) int {
if true {
output = append(output,
fmt.Sprintf(" ID: %s", g.Id),
)
}
if c.FlagRecursive {
output = append(output,
fmt.Sprintf(" Scope ID: %s", g.Scope.Id),
)
}
if true {
output = append(output,
fmt.Sprintf(" Version: %d", g.Version),
)
}