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

Support partial app IDs

Open lornajane opened this issue 7 years ago • 4 comments
trafficstars

Steps to reproduce

Looked at my apps: nexmo apps Wondered which numbers were linked for a specific app: nexmo app:numbers .... then I typed a few characters of the start of the app ID. Turns out, you need the whole thing. Not very easy from CLI.

Expected behavior

We should only require enough characters to uniquely identify which app we mean - similar to what git does with revision numbers.

Actual behavior

I had to type all 36 characters despite only having 4 apps and no common starting strings between them.

lornajane avatar Aug 13 '18 09:08 lornajane

Hey, @lornajane I'll give this a shot. :+1:

Ricool06 avatar Oct 13 '18 13:10 Ricool06

Is it acceptable to make another API call to do this? From what I've read in the code, the only way to do this in this project alone is to retrieve a list of all apps, then fail if 0 or >1 app contains a partial match, and succeed if exactly 1 app ID partially matches the argument.

Ricool06 avatar Oct 13 '18 13:10 Ricool06

Yes, that's acceptable.

AlexLakatos avatar Oct 13 '18 14:10 AlexLakatos

Pull request is up, forgot to say. Feedback welcome 😁

Ricool06 avatar Oct 13 '18 23:10 Ricool06