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
[resotocore][feat] Add list table output #1812
Conversation
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #1812 +/- ##
==========================================
- Coverage 89.98% 89.97% -0.01%
==========================================
Files 91 91
Lines 15502 15525 +23
==========================================
+ Hits 13949 13969 +20
- Misses 1553 1556 +3
Flags with carried forward coverage won't be shown. Click here to find out more.
☔ View full report in Codecov by Sentry. |
resotocore/resotocore/cli/command.py
Outdated
@@ -2553,6 +2555,7 @@ def args_info(self) -> ArgsInfo: | |||
return [ | |||
ArgInfo("--csv", help_text="format", option_group="format"), | |||
ArgInfo("--markdown", help_text="format", option_group="format"), | |||
ArgInfo("--table", help_text="format", option_group="format"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be list --json
Since list already implies that we're only outputting the list view, just that instead of markdown or key=value it's represented as json?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was starting like this as well and thought that table
describes the output better
{columns=[....]}
{row={...}}
{row={...}}
{row={...}}
I can also download csv or markdown in json, ndjson, xml, etc.
$> echo "search is(instance) | list --csv" | http :8980/cli/execute "Content-Type: text/plain"
HTTP/1.1 200 OK
Content-Type: application/json
[ "\"kind\",\"id\",\"name\",\"instance_memory\",\"age\",\"last_update\",\"cloud\",\"account\",\"region\",\"zone\"",
"\"kubernetes_node\",\"0c6d10e4-d9d5-458d-a561-f6d7c1b9cd47\",\"fixsaas-ccx23-pool-jobs-worker1\",15.2413330078125,\"14d10h\",\"14d10h\",\"k8s\",\"dev\",\"default\",\"\""
]
What about --json-table
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like --json-table
. It's very clear what you get with it.
Description
To-Dos
tox
Code of Conduct
By submitting this pull request, I agree to follow the code of conduct.