Confusing command-line parsing for --noheader
Thanks for creating and maintaining this package, it looks very useful! Just a small suggestion from a newcomer who had a rather bumpy time getting started. I tried:
$ csvtojson --noheader file.csv
Unknown boolean value for parameter --noheader.
[... 33 lines of helptext ]
So then I tried
$ csvtojson --noheader true file.csv
Unknown boolean value for parameter --noheader.
[... 33 lines of helptext ]
At this point I dug into the source and found that the accepted syntax is
$ csvtojson --noheader=true file.csv
Is there any chance you might consider making the option parsing compatible with getopt_long(3) (possibly by using a library like minimist, yargs, or commander)? If not, perhaps a clearer error message? Maybe also reducing the amount of helptext shown so errors fit on a 80x24 terminal?
Thanks for considering, Kevin
The docs are very clear IMHO
https://github.com/Keyang/node-csvtojson#header-row
@jfoclpf I don't see anything in the docs you linked about the command-line option parsing this issue describes (--noheader vs --noheader true vs --noheader=true). Even if it were documented, I would argue it is better to follow the getopt parsing conventions users are likely to expect rather than documenting non-standard conventions.
you're right, I read it too quickly