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

CLI: Add --raw option to verdi code list #5763

Merged
merged 1 commit into from
Nov 16, 2022

Conversation

sphuber
Copy link
Contributor

@sphuber sphuber commented Nov 16, 2022

Fixes #5762

If the flag is specified, the output will only print the projected data without decorative table graphics or additional information.

If the flag is specified, the output will only print the projected data
without decorative table graphics or additional information.
@sphuber
Copy link
Contributor Author

sphuber commented Nov 16, 2022

@hujay2019 these changes will provide your feature request.

@sphuber sphuber requested a review from ltalirz November 16, 2022 09:36
Copy link
Member

@ltalirz ltalirz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cheers @sphuber - having a "raw" output for these commands is certainly useful; since we are adding this now, however, it might make sense to think a little bit about the approach.

Instead of adding an option specifically for hiding output that is meant for interactive use, I would suggest instead to add a generic --output-format option that defaults to, say, interactive, but can also be set to tabular, etc. (see e.g. the example of the kubectl cli).

Our tabular format is still rather aiida-specific and requires the user to parse it. We therefore may eventually want to add other formats - e.g. JSON is very easy to further process with cli tools like jq.

@sphuber
Copy link
Contributor Author

sphuber commented Nov 16, 2022

Instead of adding an option specifically for hiding output that is meant for interactive use, I would suggest instead to add a generic --output-format option that defaults to, say, interactive, but can also be set to tabular, etc. (see e.g. the example of the kubectl cli). Our tabular format is still rather aiida-specific and requires the user to parse it. We therefore may eventually want to add other formats - e.g. JSON is very easy to further process with cli tools like jq.

Good point, but we should probably open another feature request for this. The --raw option is already omnipresent in the CLI, here we are just adding it for verdi code list. Don't think we should introduce a new concept for this one-off feature request.

@ltalirz ltalirz self-requested a review November 16, 2022 10:47
Copy link
Member

@ltalirz ltalirz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, in that case fine to add it here as well for the moment

@sphuber sphuber merged commit 17b3fb8 into aiidateam:main Nov 16, 2022
@sphuber sphuber deleted the feature/5762/verdi-code-list-raw branch November 16, 2022 10:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add --raw option to verdi code list
2 participants