Sort help message options by column instead of by row when an invalid command/subcommand is given
- Dominant language
- Python
- Stars
- 17.3k
- Forks
- 4.6k
- Avg merge
- 1d 2h
- Merged PRs (30d)
- 13
Description
### Describe the feature
When running an invalid command, the valid options displayed are sorted by row:
```
$ aws lambda foo
...
add-permission | create-alias
create-event-source-mapping | create-function
delete-alias | delete-event-source-mapping
delete-function | delete-function-concurrency
get-account-settings | get-alias
get-event-source-mapping | get-function
get-function-configuration | get-policy
invoke | invoke-async
list-aliases | list-event-source-mappings
list-functions | list-tags
list-versions-by-function | publish-version
put-function-concurrency | remove-permission
tag-resource | untag-resource
update-alias | update-event-source-mapping
update-function-code | update-function-configuration
help
```
The feature would, instead, sort the valid options by column:
```
$ aws lambda foo
...
add-permission | list-aliases
create-alias | list-event-source-mappings
create-event-source-mapping | list-functions
create-function | list-tags
delete-alias | list-versions-by-function
delete-event-source-mapping | publish-version
delete-function | put-function-concurrency
delete-function-concurrency | remove-permission
get-account-settings | tag-resource
get-alias | untag-resource
get-event-source-mapping | update-alias
get-function | update-event-source-mapping
get-function-configuration | update-function-code
get-policy | update-function-configuration
invoke | help
invoke-async |
```
Sorting should work regardless of the value given for [`ChoicesPerLine`](https://github.com/aws/aws-cli/blob/develop/awscli/argparser.py#L76).
### Use Case
Sorting the valid options for a command/subcommand may read more naturally when sorted by column instead of by row.
### Proposed Solution
#3211
### Other Information
_No response_
### Acknowledgements
- [ ] I may be able to implement this feature request
- [ ] This feature might incur a breaking change
### CLI version used
any
### Environment details (OS name and version, etc.)
any
Contributor guide
Assessment
This issue has not been assessed yet.