YS-L / csvlens

Command line csv viewer
MIT License
2.47k stars 41 forks source link

Accept slash-t for tab as delimiter argument #49

Closed peterjc closed 7 months ago

peterjc commented 7 months ago

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

shenwei356 commented 7 months ago

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

peterjc commented 7 months ago

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

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

JojiiOfficial commented 7 months ago

see #47

peterjc commented 7 months ago

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

YS-L commented 7 months ago

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

YS-L commented 7 months ago

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