msbot
Version:
MSBot command line tool for manipulating Microsoft Bot Framework .bot files
41 lines • 1.51 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
/**
* Copyright(c) Microsoft Corporation.All rights reserved.
* Licensed under the MIT License.
*/
// tslint:disable:no-console
const chalk = require("chalk");
const program = require("commander");
program.option('--prefix', 'Append [msbot] prefix to all messages');
program.Command.prototype.unknownOption = (flag) => {
console.error(chalk.default.redBright(`Unknown arguments: ${flag}`));
showErrorHelp();
};
program
.name('msbot connect')
.command('appinsights', 'connect to Azure AppInsights')
.command('blob', 'connect to Azure Blob storage')
.command('bot', 'connect to Azure Bot Service')
.command('cosmosdb', 'connect to Azure CosmosDB')
.command('dispatch', 'connect to a Dispatch model')
.command('endpoint', 'connect to endpoint')
.command('file', 'connect to file to the bot')
.command('generic', 'connect to generic service configuration')
.command('luis', 'connect to a LUIS application')
.command('qna', 'connect to QNA a service');
const args = program.parse(process.argv);
// args should be undefined is subcommand is executed
if (args) {
const a = process.argv.slice(2);
console.error(chalk.default.redBright(`Unknown arguments: ${a.join(' ')}`));
showErrorHelp();
}
function showErrorHelp() {
program.outputHelp((str) => {
console.error(str);
return '';
});
process.exit(1);
}
//# sourceMappingURL=msbot-connect.js.map