#242: Powershell generator should allow explicitly specifying the powershell cmdlet name

This commit is contained in:
Andre Rodrigues 2012-04-30 15:55:24 -07:00
Родитель 3a0809d9ac
Коммит 112c4f2bdd
2 изменённых файлов: 14 добавлений и 1 удалений

Просмотреть файл

@ -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 // Allow cli.password to accept empty passwords
commander.Command.prototype.password = function (str, mask, fn) { commander.Command.prototype.password = function (str, mask, fn) {
var self = this var self = this

Просмотреть файл

@ -31,8 +31,15 @@ function buildModel(root) {
} }
focus.commands.forEach(function (command) { focus.commands.forEach(function (command) {
var powershellName;
if (command.powershellName) {
powershellName = command.powershellName;
} else {
powershellName = leadingCapital(command.name) + '-Azure' + suffix;
}
var cmdlet = { var cmdlet = {
name: leadingCapital(command.name) + '-Azure' + suffix, name: powershellName,
command: command, command: command,
parameters: [] parameters: []
}; };