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

Normalize command names #143

Open
2 tasks
AlexLakatos opened this issue Jun 13, 2017 · 6 comments
Open
2 tasks

Normalize command names #143

AlexLakatos opened this issue Jun 13, 2017 · 6 comments
Assignees

Comments

@AlexLakatos
Copy link
Contributor

AlexLakatos commented Jun 13, 2017

This is a meta issue, tracking conventions for the CLI

  • all commands should be plural
  • map :list to the default single word command
@cbetta
Copy link
Contributor

cbetta commented Jun 13, 2017

I don't agree with this. All commands should be usable, and seeing as people will forget if it's number:list or numbers:list, it's useful for both to exist.

@leggetter
Copy link
Contributor

leggetter commented Jun 13, 2017

As a comparison, Heroku is strict about this and it's a good CLI.`

nexmo-cli/ on develop
› heroku apps
=== phil@leggetter.co.uk Apps

vs.

nexmo-cli/ on develop
› heroku app
 ▸    app is not a heroku command.
 ▸    Perhaps you meant apps?
 ▸    Run heroku _ to run heroku apps.
 ▸    Run heroku help for a list of available commands.

@cbetta
Copy link
Contributor

cbetta commented Jun 13, 2017

@leggetter sure, so the 2 options are to either support multiple commands for one action, or to be strict and have decent fallback. We've gone the former way so far and we shouldn't drop it without understanding why it's there.

I'm all open to the latter option, but this means adding some graceful fallback for these kind of typos, as well as bumping the major version for removing so much backwards compatibility.

@leggetter
Copy link
Contributor

we shouldn't drop it without understanding why it's there

Agreed.

To be clear: Reason for this issue are:

  • maintaining the original way seems like overhead and results in mistakes as we've just seen See Deduplicate bin.js #14
  • nexmo help shows apps:list and app:create. Is this more intuitive or should be be consistent with singular/plural the prefix?

It could be that we were just unlucky with the recent numbers:list problem and it could be better fixed by actually getting a fix (or workaround) for alias tj/commander.js#531

For a workaround we could potentially just create our own helper function wrapper.

@cbetta
Copy link
Contributor

cbetta commented Jun 13, 2017

@AlexLakatos just wanted to apologise for possibly being short and grumpy, no such thing was intended. I was at a conference abroad and answering quickly and to the point and I just realised I might have sounded a bit rude. I totally love that someone is trying to improve things, and all I wanted to do was provide some background.

@sammachin
Copy link
Contributor

The original spec had number and numbers as an alias, because depending on what you are doing the plural makes sense to read the command so number:update but numbers:search however it shouldn't matter if you use number or numbers in any command, same for apps

It might make the code more complex but it makes the product more usable IMO

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