Closed leggetter closed 7 years ago
@leggetter so there's some thought that has gone into this.
In general, any command without -v
returns something that can be easily parsed/piped into another method.
So in the case of numbers:list
it just returns numbers, which you can then parse to find the right numbers, etc:
nexmo nl
442039051100
447520619323
nexmo nl | grep 2
447520619323
By adding -v
to a method we do not just add more info, but also more UI to the response:
Item 1-10 of 2
msisdn | country | type | features | voiceCallbackType | voiceCallbackValue | moHttpUrl | voiceStatusCallbackUrl
-----------------------------------------------------------------------------------------------------------------------------------------------
442039051100 | GB | landline | VOICE | app | 91064c2b-abcd-abcd-abcd-f00000000 | undefined | undefined
447520619323 | GB | mobile-lvn | VOICE,SMS | undefined | undefined | undefined | undefined
In other words, I understand the customer's request, but making the requested change would break from the standard across all methods.
One solution would be to by default return the verbose
result, and instead add a -q
(quiet) flag for those who need it.
Really good point and good suggestion.
I think all commands should behave in the same way. If one of the goals is to ensure the output can be piped into another command then sending the verbose output by default makes that more difficult.
Would adding a line to the start or end that had paging information be a hinderance to this goal? It would mean it'd have to be stripped, but I'd assume that's not difficult? Or should you always avoid metadata?
Aside: Item 1-10 of 2
could be confusing. It does mean pages but it's in the context of "Item". So maybe it should say Item 1-10. Page 1 of 2.
or similar.
Regarding the aside, that's a bug ;)
Regarding the main issue: yeah not sure. It would have to be stripped indeed. It would also break backwards compatibility massively for anyone currently using the CLI in this way.
Alternative idea:
Let's up the default page size for the CLI to the max. This means only people with a lot of numbers will have this issue, which is a pretty small group of people I guess?
This is also related to #51
I like this idea of upping the default to the max in a request, I think its 100?
Via support: