smartcli/ts/index.ts

26 lines
1.0 KiB
TypeScript
Raw Normal View History

2015-10-04 21:21:10 +00:00
/// <reference path="typings/tsd.d.ts" />
2015-11-05 20:43:34 +00:00
/// <reference path="./smartcli.plugins.ts" />
/// <reference path="./smartcli.interfaces.ts" />
/// <reference path="./smartcli.checks.ts" />
/// <reference path="./smartcli.getters.ts" />
/// <reference path="./smartcli.interaction.ts" />
2015-10-04 21:21:10 +00:00
2015-11-05 20:43:34 +00:00
var plugins = smartcliPlugins.init(); //get all the required npm modules under plugins
2015-10-04 21:21:10 +00:00
2015-10-05 21:33:57 +00:00
//define the smartcli object
var smartcli:any = {};
2015-10-04 21:21:10 +00:00
2015-10-05 21:33:57 +00:00
//add plugins from above for direct use
2015-11-05 20:43:34 +00:00
smartcli.inquirer = plugins.inquirer; //inquirer is for asking questions
smartcli.cliff = plugins.cliff; // formats cli output
smartcli.argv = plugins.argv; //argv gets initial cli commands and options.
2015-10-05 21:33:57 +00:00
2015-11-05 20:43:34 +00:00
//init checks. Checks return boolean. That means they can be used as question with an answer of yes or no.
2015-10-06 23:07:38 +00:00
SmartcliChecks.init(); // is defined in smartcli.checks.ts
SmartcliGetters.init(); // is defined in smartcli.getters.ts
SmartcliInteraction.init(); // is defined in smartcli.interaction.ts
2015-10-06 23:07:38 +00:00
module.exports = smartcli; // expose smartcli to outside world