Skip to content
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

Enhancement: Unify <list>,<ls> sub-commands parameters #1026

Closed
tregubovav-dev opened this issue Jul 20, 2024 · 1 comment
Closed

Enhancement: Unify <list>,<ls> sub-commands parameters #1026

tregubovav-dev opened this issue Jul 20, 2024 · 1 comment
Assignees
Milestone

Comments

@tregubovav-dev
Copy link

Issue

Incus provides list sub-commands in multiple commands. Some of them have advanced options like --format and --columns, but some does not have such options. Unified set of options significantly simplifies automation scripts development.
Below is subset of commands with different options availability:

  • incus list, incus cluster list, incus storage list, incus network list, etc. provide both --format and --columns options
  • incus cluster list-tokens, incus cluster group list, incus snapshot list, incus storage bucket list provides the only --format option.
  • incus admin cluster list-database has no options. Even it provides single column output --format option may be useful.

There were many list'-like commands received --formatand--columns` options since forking from the LXD. I would appreciate it if all remaining commands could receive these options.

P.S.

Two more possible enhancements:

  • header-less format output would be useful at least for compact format option. For example: --format compact-no-header. It could be used with shell commands or scripts like in example below:
for inst in $(incus list <name pattern> -f compact-no-header -c n) do; incus exec $inst -- <do something in the instance>; done
  • incus top could be enhances with --format and --columns options and no-waiting for user input.
@stgraber
Copy link
Member

I've split up things into a couple more issues and I've got the rest sorted out in a PR.

stgraber added a commit to stgraber/incus that referenced this issue Jul 20, 2024
This adds support for format options in table output.
For now, this adds `noheader` as a way to remove the header line in
table and compact output.

Closes lxc#1026

Signed-off-by: Stéphane Graber <stgraber@stgraber.org>
stgraber added a commit that referenced this issue Jul 22, 2024
Closes #1026

Signed-off-by: Stéphane Graber <stgraber@stgraber.org>
stgraber added a commit that referenced this issue Jul 22, 2024
This adds support for format options in table output.
For now, this adds `noheader` as a way to remove the header line in
table and compact output.

Closes #1026

Signed-off-by: Stéphane Graber <stgraber@stgraber.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants