Nexmo / nexmo-cli

Nexmo CLI (Command Line Interface)
https://nexmo.com
MIT License
78 stars 52 forks source link

Normalize command names #143

Open AlexLakatos opened 7 years ago

AlexLakatos commented 7 years ago

This is a meta issue, tracking conventions for the CLI

cbetta commented 7 years ago

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 commented 7 years ago

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 commented 7 years ago

@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 commented 7 years ago

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

Agreed.

To be clear: Reason for this issue are:

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.

cbetta commented 7 years ago

@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 commented 7 years ago

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