I am using optimist for node.js, and want to parse the input like this:
$ command some args -m this is the message
into this
{argv:{_:['some','args'],m:'this is the message'}}
is this possible with optimist?
is this possible in general?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I ended up doing this, which works for my use case:
EDIT:
Actually there are still problems with this method. I ended up doing something else, but am still in search of a better solution. I think I am going to end up writing a small peg parser to parse the command line options how I want.