apache / apache/cordova-cli

Rewrite CLI using better options parser (possibly yargs)

Open
#311 4 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
JavaScript
Stars
967
Forks
344
Avg merge
8h 41m
Merged PRs (30d)
9

Description

### Requirements
- sub-command support
- generate usage text from specification

AFAICT, `nopt` does not satisfy any of those, so let's look at [some alternatives](https://www.npmtrends.com/minimist-vs-optimist-vs-yargs-vs-commander-vs-optionator-vs-nopt-vs-meow).

### Disqualifications
- `meow` and `optionator` have no sub-command support: https://github.com/sindresorhus/meow/issues/69, https://github.com/gkz/optionator/issues/6
- `optimist` and `minimist` are not maintained anymore: https://github.com/substack/node-optimist/issues/132, https://github.com/substack/minimist/issues/115

That leaves us with [`yargs` vs `commander`](https://www.npmtrends.com/yargs-vs-commander). Multiple reasons let me favor `yargs`:
- Seemingly better docs
- Faster growing download count (= popularity?)
- Younger project
- The pirate theme :wink:

Related: #309

Contributor guide

Open the contributing guide

Research direction

Start by reviewing how the CLI currently uses nopt and read related issue #309. Compare yargs and commander against the stated requirements, especially sub-command support and generating usage text from a specification. The work is done when the CLI uses a suitable parser and satisfies both requirements.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, node.js
Domain
cli
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.