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

Accept slash-t for tab as delimiter argument #49

Merged
merged 2 commits into from
Jan 9, 2024
Merged

Conversation

peterjc
Copy link
Contributor

@peterjc peterjc commented Jan 8, 2024

Cross reference #19, currently to use a tab you must use:

$ csvlens -d $'\t' ...

With this change the following are also accepted:

$ csvlens -d '\t' ...
$ csvlens -d "\t" ...

This convention is used elsewhere, including the xsv and qsv tools:

https://github.com/BurntSushi/xsv/blob/0.13.0/src/config.rs#L37

https://github.com/jqnatividad/qsv/blob/0.121.0/src/config.rs#L47

Currently to use a tab you must use:

$ csvlens -d $'\t' ...

With this change the following are also accepted:

$ csvlens -d '\t' ...
$ csvlens -d "\t" ...
@shenwei356
Copy link

It would be great if there's a flag -t. 😃

@peterjc
Copy link
Contributor Author

peterjc commented Jan 8, 2024

I can see the attraction of -t as an alias for tab delimiters, implementing it might be a stretch for my rust skills 😉

Would the authors want to add another command line switch though?

@JojiiOfficial
Copy link
Contributor

see #47

@peterjc
Copy link
Contributor Author

peterjc commented Jan 9, 2024

That's amusing timing, two related pull requests the same day - both trying to make it easier to work with TSV files 😀

@YS-L
Copy link
Owner

YS-L commented Jan 9, 2024

This is great! Would you mind fixing the lint error?

@YS-L
Copy link
Owner

YS-L commented Jan 9, 2024

Thank you @peterjc and @JojiiOfficial, interesting timing indeed. And I'm going to merge both! :)

@YS-L YS-L merged commit 10235be into YS-L:main Jan 9, 2024
6 checks passed
@peterjc peterjc deleted the slash_t branch January 9, 2024 16:35
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.

4 participants