From 0910c2aeebb0d81fafef75b29239a584156d3b45 Mon Sep 17 00:00:00 2001 From: Will Vedder Date: Tue, 14 Nov 2023 10:32:25 -0500 Subject: [PATCH] DXCDT-592: Adding lucene examples to `auth0 users search` (#912) * Adding search query examples to users search command * Adding parentheses * Adding wildcard * Changing text --------- Co-authored-by: Will Vedder --- docs/auth0_users_search.md | 12 ++++++++---- internal/cli/users.go | 2 +- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/docs/auth0_users_search.md b/docs/auth0_users_search.md index d2d0614ec..f24111285 100644 --- a/docs/auth0_users_search.md +++ b/docs/auth0_users_search.md @@ -26,10 +26,14 @@ auth0 users search [flags] ## Flags ``` - --json Output in json format. - -n, --number int Number of users, that match the search criteria, to retrieve. Minimum 1, maximum 1000. If limit is hit, refine the search query. (default 50) - -q, --query string Query in Lucene query syntax. See https://auth0.com/docs/users/user-search/user-search-query-syntax for more details. - -s, --sort string Field to sort by. Use 'field:order' where 'order' is '1' for ascending and '-1' for descending. e.g. 'created_at:1'. + --json Output in json format. + -n, --number int Number of users, that match the search criteria, to retrieve. Minimum 1, maximum 1000. If limit is hit, refine the search query. (default 50) + -q, --query email:"user123@*.com" OR (user_id:"user-id-123" AND name:"Bob") Search query in Lucene query syntax. + + For example: email:"user123@*.com" OR (user_id:"user-id-123" AND name:"Bob") + + For more info: https://auth0.com/docs/users/user-search/user-search-query-syntax. + -s, --sort string Field to sort by. Use 'field:order' where 'order' is '1' for ascending and '-1' for descending. e.g. 'created_at:1'. ``` diff --git a/internal/cli/users.go b/internal/cli/users.go index 6c39a91ea..84b906ba0 100644 --- a/internal/cli/users.go +++ b/internal/cli/users.go @@ -62,7 +62,7 @@ var ( Name: "Query", LongForm: "query", ShortForm: "q", - Help: "Query in Lucene query syntax. See https://auth0.com/docs/users/user-search/user-search-query-syntax for more details.", + Help: "Search query in Lucene query syntax.\n\nFor example: `email:\"user123@*.com\" OR (user_id:\"user-id-123\" AND name:\"Bob\")`\n\n For more info: https://auth0.com/docs/users/user-search/user-search-query-syntax.", IsRequired: true, } userSort = Flag{