mirror of
https://github.com/passbolt/go-passbolt-cli.git
synced 2025-09-13 14:59:09 +00:00
Implement CEL filter in list user command
This commit is contained in:
parent
6562aeab95
commit
f30590588e
2 changed files with 78 additions and 0 deletions
|
@ -62,6 +62,10 @@ func UserList(cmd *cobra.Command, args []string) error {
|
|||
if err != nil {
|
||||
return err
|
||||
}
|
||||
celFilter, err := cmd.Flags().GetString("filter")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
ctx := util.GetContext()
|
||||
|
||||
|
@ -82,6 +86,11 @@ func UserList(cmd *cobra.Command, args []string) error {
|
|||
return fmt.Errorf("Listing User: %w", err)
|
||||
}
|
||||
|
||||
users, err = filterUsers(&users, celFilter, ctx)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if jsonOutput {
|
||||
outputUsers := []UserJsonOutput{}
|
||||
for i := range users {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue