Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
raphinesse opened this issue Aug 30, 2018 · 4 comments
Open

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

raphinesse opened this issue Aug 30, 2018 · 4 comments

Comments

@raphinesse
Copy link
Contributor

raphinesse commented Aug 30, 2018

Requirements

  • sub-command support
  • generate usage text from specification

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:

  • Seemingly better docs
  • Faster growing download count (= popularity?)
  • Younger project
  • The pirate theme 😉

Related: #309

@raphinesse raphinesse changed the title Rewrite CLI using better options parser Rewrite CLI using better options parser (possibly yargs) Aug 30, 2018
@Menardi
Copy link
Contributor

Menardi commented Sep 1, 2018

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
Copy link
Contributor Author

raphinesse commented Sep 2, 2018

@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
Copy link

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
Copy link

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! 👐

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants