summaryrefslogtreecommitdiffstats
path: root/awxkit
diff options
context:
space:
mode:
authorRyan Mahaffey <ryan.mahaffey@thetradedesk.com>2023-01-28 03:21:34 +0100
committerRyan Mahaffey <ryan.mahaffey@thetradedesk.com>2023-01-28 03:21:34 +0100
commitc9d931ceeef70bc2d6a798c7fe764aa571cc37a4 (patch)
tree8f9c4f5e3a53517d7a339aed1fb9e2f659fabedb /awxkit
parentMerge pull request #13476 from john-westcott-iv/security_requested_change (diff)
downloadawx-c9d931ceeef70bc2d6a798c7fe764aa571cc37a4.tar.xz
awx-c9d931ceeef70bc2d6a798c7fe764aa571cc37a4.zip
add '--order-by' option as supplied by the awx api
Diffstat (limited to 'awxkit')
-rw-r--r--awxkit/awxkit/cli/options.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/awxkit/awxkit/cli/options.py b/awxkit/awxkit/cli/options.py
index fe200f71a1..c466da68e8 100644
--- a/awxkit/awxkit/cli/options.py
+++ b/awxkit/awxkit/cli/options.py
@@ -122,6 +122,15 @@ class ResourceOptionsParser(object):
action='store_true',
help=('fetch all pages of content from the API when ' 'returning results (instead of just the first page)'),
)
+ parser.add_argument(
+ '--order_by',
+ dest='order_by',
+ help=(
+ 'order results by given field name, '
+ 'prefix the field name with a dash (-) to sort in reverse eg --order_by=\'-name\','
+ 'multiple sorting fields may be specified by separating the field names with a comma (,)'
+ ),
+ )
add_output_formatting_arguments(parser, {})
def build_detail_actions(self):