Skip to content

Commit

Permalink
Add a closed flag to the list requests command (#93)
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshuaWilkes authored Sep 13, 2024
1 parent 0608f93 commit a6ee29d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/wise-worms-pull.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@common-fate/cli": patch
---

Adds the option to list closed access requests. 'cf access list requests --closed'
2 changes: 2 additions & 0 deletions cmd/cli/command/access/list/requests.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ var requestsCommand = cli.Command{
Flags: []cli.Flag{
&cli.StringFlag{Name: "output", Value: "table", Usage: "output format ('table', 'wide', or 'json')"},
&cli.BoolFlag{Name: "order-ascending", Usage: "list requests in ascending chronological order"},
&cli.BoolFlag{Name: "closed", Usage: "list closed requests"},
},
Action: func(c *cli.Context) error {
ctx := c.Context
Expand All @@ -45,6 +46,7 @@ var requestsCommand = cli.Command{
res, err := client.QueryAccessRequests(ctx, connect.NewRequest(&accessv1alpha1.QueryAccessRequestsRequest{
PageToken: pageToken,
Order: grab.If(c.Bool("order-ascending"), entityv1alpha1.Order_ORDER_ASCENDING.Enum(), entityv1alpha1.Order_ORDER_DESCENDING.Enum()),
Archived: c.Bool("closed"),
}))
if err != nil {
return err
Expand Down

0 comments on commit a6ee29d

Please sign in to comment.