cli icon indicating copy to clipboard operation
cli copied to clipboard

Feature request: allow sorting to be configured globally

Open cedi opened this issue 3 years ago • 4 comments

I am a heavy user of the hcloud-cli. However, I really don't like the default sorting by server-id, and would prefer sorting by age (see #417 where I request adding a computed "age" column) or name.

Currently, I always type hcloud server list -s name to sort by name.

since the -s flag is part of the list subcommand and not the hcloud base command, I cannot simply alias hcloud-"hcloud -s name" in my shell to default the sorting to "by name". I think this could be implemented as part of the configuration toml. I would expect the following behavior:

config file flag result
not-set not-set sort by id (default)
not-set set sort by flag value
set not-set sort by config value
set set sort by flag value

I would also volunteer to implement this myself and submit a PR, but I wanted to gauge interest first, before putting in some work and having the PR rejected.

cedi avatar Nov 13 '22 14:11 cedi

This issue has been marked as stale because it has not had recent activity. The bot will close the issue if no further action occurs.

github-actions[bot] avatar Feb 12 '23 12:02 github-actions[bot]

@apricote bump

cedi avatar Feb 15 '23 10:02 cedi

This issue has been marked as stale because it has not had recent activity. The bot will close the issue if no further action occurs.

github-actions[bot] avatar Jun 16 '23 12:06 github-actions[bot]

This issue has been marked as stale because it has not had recent activity. The bot will close the issue if no further action occurs.

github-actions[bot] avatar Sep 15 '23 12:09 github-actions[bot]

Feature was implemented in #795 - see my comment here: https://github.com/hetznercloud/cli/pull/421#issuecomment-2220279864 Since the feature is now implemented I will close this issue as completed. Thanks for your suggestion!

phm07 avatar Jul 11 '24 10:07 phm07