-
Notifications
You must be signed in to change notification settings - Fork 81
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature request: allow sorting to be configured globally #418
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 hetznercloud#417/hetznercloud#420) 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 (like in many other software that makes use of the Cobra framework), I cannot simply `alias hcloud-"hcloud -s name"` in my shell to default the sorting to "by name". This commit adds a `[defaults]` section to the config toml which allows to override the default sorting behavior for individual `hcloud` subcommands. The following behavior is used to determine the sorting-order | 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 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 hetznercloud#417/hetznercloud#420) 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 (like in many other software that makes use of the Cobra framework), I cannot simply `alias hcloud-"hcloud -s name"` in my shell to default the sorting to "by name". This commit adds a `[defaults]` section to the config toml which allows to override the default sorting behavior for individual `hcloud` subcommands. The following behavior is used to determine the sorting-order | 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 |
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. |
@apricote bump |
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. |
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. |
Feature was implemented in #795 - see my comment here: #421 (comment) |
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 thelist
subcommand and not thehcloud
base command, I cannot simplyalias 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:
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.
The text was updated successfully, but these errors were encountered: