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

Use a better lib arguments lib than commander #131

Open
doubleface opened this issue Mar 13, 2018 · 3 comments
Open

Use a better lib arguments lib than commander #131

doubleface opened this issue Mar 13, 2018 · 3 comments

Comments

@doubleface
Copy link
Collaborator

Commander lacks of feature about default values for arguments and there are more modern argument parsing librairies.

Konitor already uses yargs and I propose to use it.

@ptbrowne
Copy link
Contributor

I wonder if @CPatchane has any thought about this ?

@CPatchane
Copy link
Contributor

What is konitor? I don't find any projects with this name.
Do you have an example of needs that where commander is not enough?

@ptbrowne
Copy link
Contributor

ptbrowne commented Mar 16, 2018

Konitor : https://github.com/konnectors/konitor

Two examples where IMHO commander does not shine :

positional arguments

commander seems more gearer towards options than arguments. It does not provide a way to easily parse positional arguments for example.

let file

program
  .arguments('<file>')
  .action(_file => file = path.absname(_file))

seems to be the normal way of doing things with commander. I think it is not very convenient.

subcommands

With commander, when you have a program with subcommands, it does not fail if the subcommand does not exist so you have to write custom code to handle the case : https://gitlab.cozycloud.cc/labs/ACH/commit/f2499c29d9d0d606ecd47ee1e45a6192b5be0757.

It feels like commander is half-baked, I would be happy to be wrong, tell me if I overlooked some things :/

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

No branches or pull requests

3 participants