#242: Powershell generator should allow explicitly specifying the powershell cmdlet name
This commit is contained in:
Родитель
3a0809d9ac
Коммит
112c4f2bdd
|
@ -296,6 +296,12 @@ function enableNestedCommands(command) {
|
|||
});
|
||||
}
|
||||
|
||||
// Allow commands to specify powershell name.
|
||||
commander.Command.prototype.withPowershellName = function (name) {
|
||||
this.powershellName = name;
|
||||
return this;
|
||||
};
|
||||
|
||||
// Allow cli.password to accept empty passwords
|
||||
commander.Command.prototype.password = function (str, mask, fn) {
|
||||
var self = this
|
||||
|
|
|
@ -31,8 +31,15 @@ function buildModel(root) {
|
|||
}
|
||||
|
||||
focus.commands.forEach(function (command) {
|
||||
var powershellName;
|
||||
if (command.powershellName) {
|
||||
powershellName = command.powershellName;
|
||||
} else {
|
||||
powershellName = leadingCapital(command.name) + '-Azure' + suffix;
|
||||
}
|
||||
|
||||
var cmdlet = {
|
||||
name: leadingCapital(command.name) + '-Azure' + suffix,
|
||||
name: powershellName,
|
||||
command: command,
|
||||
parameters: []
|
||||
};
|
||||
|
|
Загрузка…
Ссылка в новой задаче