paf31 / purescript-yargs

PureScript bindings for the yargs command-line parsing library
MIT License
17 stars 12 forks source link

Commands? #7

Open damncabbage opened 8 years ago

damncabbage commented 8 years ago

I've been trying to come up with a way to add .command() support to this library. I'm drawing a complete blank. Any ideas? :cold_sweat:

(The relevant Yargs docs: https://www.npmjs.com/package/yargs#commandcmd-desc-fn)

paf31 commented 8 years ago

Perhaps the best way is to use the version which takes a function, since that corresponds to a nested YargsSetup.

damncabbage commented 8 years ago

Yeah. I started there, but I struggled to plumb it all together into something that'll let you match some commands up to a sum-type of constructors with their own set of options, or... I'm struggling to think of the interface to all this, sorry.

(I had a brainstorm with @anttih a couple of months back, but came up blank.)