Closed Chovin closed 5 years ago
I think that's fine.
Thanks for making the changes. Are there any other commands with more than one alias left in the bin file?
no more. all clean! 😄
[09:31:06] (master) src
// ♥pcregrep -M "^commander((.|\n )*?alias){2}" bin.js
commander
.command('number:buy [number_pattern]')
.description('Buy a number to use for voice or SMS. If a --country_code is provided then the number_pattern is used to sea
rch for a number in the given country.')
.alias('numbers:buy')
.alias('nb')
[09:31:11] (master) src
// ♥git checkout patch-1
Switched to branch 'patch-1'
Your branch is up to date with 'origin/patch-1'.
[09:31:19] (patch-1) src
// ♥pcregrep -M "^commander((.|\n )*?alias){2}" bin.js
[09:31:21] (patch-1) src
// ♥
Thanks for checking. And thanks for the PR!
Summary
moved
numbers:buy
into a separate command so the alias is not overwritten bynb
. This doesn't seem very DRY though and I'm not quite sure how to make sure this doesn't happen since commander silently overwrites the alias. Subclass it?What would be the preferred way to handle this?
Other Information
partially handles #141
Thanks for contributing to the Nexmo CLI!