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

Add --nested-fields={error,omit,json} for CSV #55

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

ttencate
Copy link

These apply to both cat and head subcommands, and specify how to handle nested fields if the output format is CSV (which does not support nested fields). The default, --nested-fields=error, just exits with a helpful error message.

This also changes the printing of errors escaping from the main() function to use Display, rather than Debug, in order to make them more user-friendly:

Columns encountered with nested field types, which are not supported in CSV: ["country"]
Hint: Use `--nested-fields=omit` to omit them, or `--nested-fields=json` to encode them as JSON.

Fixes #54.

These apply to both `cat` and `head` subcommands, and specify how to
handle nested fields if the output format is CSV (which does not support
nested fields). The default, `--nested-fields=error`, just exits with a
helpful error message.

This also changes the printing of errors escaping from the `main()`
function to use `Display`, rather than `Debug`, in order to make them
more user-friendly.

Fixes manojkarthick#54.
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 support for nested fields in CSV by encoding them as JSON
1 participant