Skip to content

Commit 76fe691

Browse files
Fix: changing --order_by to --order-by to match CLI flag conventions (#508)
## 📝 Description Changes `--order_by`flag to `--order-by` to match CLI conventions. Also added a print statements for `--help` for list actions. ## ✔️ How to Test `linode-cli linodes list --order-by label` `linode-cli linodes list --help`
1 parent 6a088ac commit 76fe691

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

linodecli/api_request.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ def _build_filter_header(
150150
if p.name in parsed_args_dict:
151151
del parsed_args_dict[p.name]
152152

153-
# check for order_by and order
153+
# check for order-by and order
154154
order_by = parsed_args_dict.pop("order_by")
155155
order = parsed_args_dict.pop("order") or "asc"
156156

linodecli/arg_helpers.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -364,6 +364,9 @@ def action_help(cli, command, action):
364364
print("You may filter results with:")
365365
for attr in filterable_attrs:
366366
print(f" --{attr.name}")
367+
print(
368+
"Additionally, you may order results using --order-by and --order."
369+
)
367370
return
368371
if op.args:
369372
print("Arguments:")

linodecli/baked/operation.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -344,9 +344,9 @@ def _add_args_filter(self, parser):
344344
type=expected_type,
345345
metavar=attr.name,
346346
)
347-
# Add --order_by and --order argument
347+
# Add --order-by and --order argument
348348
parser.add_argument(
349-
"--order_by",
349+
"--order-by",
350350
choices=filterable_args,
351351
help="Attribute to order the results by - must be filterable.",
352352
required="--order" in sys.argv,

0 commit comments

Comments
 (0)