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 key-values format to data task #398

Merged
merged 1 commit into from
Dec 1, 2021
Merged

Add key-values format to data task #398

merged 1 commit into from
Dec 1, 2021

Conversation

arjan0307
Copy link
Contributor

No description provided.

@@ -85,6 +85,8 @@ def print_forest(forest, opts, version = :show_tree)
puts forest.inspect
when 'keys'
puts forest.key_names(root: true)
when 'key-values'
puts forest.key_values(root: true).map { |kv| kv.join(' ') }
Copy link
Owner

Choose a reason for hiding this comment

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

The key can contain spaces so perhaps it's better join with a \t?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good point, although wouldn't it make more sence to use a colon?

Copy link
Owner

Choose a reason for hiding this comment

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

A colon can also be part of the key name

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Okay, I'll make it a \t. Couldn't that also be a part of the key name though? As far as I can tell every character is allowed as long as it's properly escaped.

Copy link
Owner

Choose a reason for hiding this comment

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

True but \t is unlikely whereas I've seen : and in the bug reports here

@arjan0307 arjan0307 requested a review from glebm December 1, 2021 09:11
@glebm glebm merged commit 1b9e046 into glebm:main Dec 1, 2021
@arjan0307 arjan0307 deleted the feature/key-values branch December 3, 2021 10:46
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.

2 participants