apache / cordova-cli

Apache Cordova CLI
Apache License 2.0
940 stars 340 forks source link

Rewrite CLI using better options parser (possibly yargs) #311

Open raphinesse opened 6 years ago

raphinesse commented 6 years ago

Requirements

AFAICT, nopt does not satisfy any of those, so let's look at some alternatives.

Disqualifications

That leaves us with yargs vs commander. Multiple reasons let me favor yargs:

Related: #309

Menardi commented 6 years ago

I'm not too familiar with the CLI args parsers, what does sub-command support mean in this context? I guess knowing that will probably explain the need to switch away from nopt :)

raphinesse commented 6 years ago

@Menardi I'm thinking of something like this: https://github.com/yargs/yargs/blob/master/docs/advanced.md#example-command-hierarchy-using-commanddir

I will try to provide a Motivation section to this issue when I find the time.

shadowspawn commented 4 years ago

If you wonder what Cordova might look like using Commander for the CLI, I tried emulating the Cordova CLI to try out some new features coming in Commander v5: https://github.com/shadowspawn/commander-does-cordova.git

(This isn't a recommendation to use Commander, just commenting for your possible interest.)

carloscortonc commented 1 year ago

Hi! Browsing through other cli-libraries I bumped into this issue. I have been building a cli-parser myself (for educational purposes) and reading this issue's descriptions, seems it might be a good fit: https://github.com/carloscortonc/cli-er#readme

Would love any feedback/suggestions! 👐