nexmo-cli icon indicating copy to clipboard operation
nexmo-cli copied to clipboard

Normalize command names

Open AlexLakatos opened this issue 7 years ago • 6 comments

This is a meta issue, tracking conventions for the CLI

  • [ ] all commands should be plural
  • [ ] map :list to the default single word command

AlexLakatos avatar Jun 13 '17 16:06 AlexLakatos

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.

cbetta avatar Jun 13 '17 17:06 cbetta

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

nexmo-cli/ on develop
› heroku apps
=== [email protected] 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.

leggetter avatar Jun 13 '17 17:06 leggetter

@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.

cbetta avatar Jun 13 '17 17:06 cbetta

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 #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 https://github.com/tj/commander.js/issues/531

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

leggetter avatar Jun 13 '17 19:06 leggetter

@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.

cbetta avatar Jun 13 '17 21:06 cbetta

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

sammachin avatar Aug 04 '17 11:08 sammachin