Sort options#708
Merged
Merged
Conversation
Member
|
Just some lint issues, thanks for your contribution! |
Co-authored-by: Zhiwei Liang <121905282+zliang-akamai@users.noreply.github.com>
Co-authored-by: Zhiwei Liang <121905282+zliang-akamai@users.noreply.github.com>
Co-authored-by: Zhiwei Liang <121905282+zliang-akamai@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR implements alphabetical sorting for command-line options in help menus across the Linode CLI. It addresses issue #650 by introducing a custom SortingHelpFormatter class that sorts argument options alphabetically when displaying help text.
- Adds a new
SortingHelpFormatterclass that extendsargparse.HelpFormatterto sort options alphabetically - Updates all ArgumentParser instances across plugins and core modules to use the new formatter
- Ensures consistent alphabetical ordering of command-line options in help output
Reviewed Changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| linodecli/help_formatter.py | Implements the new SortingHelpFormatter class with alphabetical sorting logic |
| linodecli/init.py | Updates main CLI parser to use the sorting formatter |
| linodecli/baked/operation.py | Updates operation parser to use the sorting formatter |
| linodecli/plugins/*.py | Updates all plugin parsers to use the sorting formatter for consistent help display |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
zliang-akamai
approved these changes
Aug 27, 2025
Member
zliang-akamai
left a comment
There was a problem hiding this comment.
Looks good and works well!
lgarber-akamai
approved these changes
Sep 15, 2025
Contributor
lgarber-akamai
left a comment
There was a problem hiding this comment.
Looks great, thank you for the contribution!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📝 Description
Solves #650
✔️ How to Test
Invoke
-hwith any command and check if options are sorted alphabetically.📷 Preview