improve intellisense
This commit is contained in:
parent
643514c64a
commit
c115d222c0
3
dist/index.js
vendored
3
dist/index.js
vendored
@ -2,5 +2,4 @@
|
|||||||
require("typings-global");
|
require("typings-global");
|
||||||
var smartcli_classes_smartcli_1 = require("./smartcli.classes.smartcli");
|
var smartcli_classes_smartcli_1 = require("./smartcli.classes.smartcli");
|
||||||
exports.Smartcli = smartcli_classes_smartcli_1.Smartcli;
|
exports.Smartcli = smartcli_classes_smartcli_1.Smartcli;
|
||||||
|
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi90cy9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBQUEsUUFBTyxnQkFBZ0IsQ0FBQyxDQUFBO0FBR3hCLDBDQUF1Qiw2QkFBNkIsQ0FBQztBQUE3Qyx3REFBNkMifQ==
|
||||||
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImluZGV4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFBQSxRQUFPLGdCQUFnQixDQUFDLENBQUE7QUFHeEIsMENBQXVCLDZCQUE2QixDQUFDO0FBQTdDLHdEQUE2QyIsImZpbGUiOiJpbmRleC5qcyIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCBcInR5cGluZ3MtZ2xvYmFsXCI7XG5cbmltcG9ydCB7U21hcnRjbGl9IGZyb20gXCIuL3NtYXJ0Y2xpLmNsYXNzZXMuc21hcnRjbGlcIjtcbmV4cG9ydCB7U21hcnRjbGl9IGZyb20gXCIuL3NtYXJ0Y2xpLmNsYXNzZXMuc21hcnRjbGlcIjtcbiJdfQ==
|
|
3
dist/smartcli.classes.command.d.ts
vendored
3
dist/smartcli.classes.command.d.ts
vendored
@ -1,3 +0,0 @@
|
|||||||
import "typings-global";
|
|
||||||
export declare class Command {
|
|
||||||
}
|
|
10
dist/smartcli.classes.command.js
vendored
10
dist/smartcli.classes.command.js
vendored
@ -1,10 +0,0 @@
|
|||||||
"use strict";
|
|
||||||
require("typings-global");
|
|
||||||
var Command = (function () {
|
|
||||||
function Command() {
|
|
||||||
}
|
|
||||||
return Command;
|
|
||||||
}());
|
|
||||||
exports.Command = Command;
|
|
||||||
|
|
||||||
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNtYXJ0Y2xpLmNsYXNzZXMuY29tbWFuZC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBQUEsUUFBTyxnQkFBZ0IsQ0FBQyxDQUFBO0FBR3hCO0lBQUE7SUFFQSxDQUFDO0lBQUQsY0FBQztBQUFELENBRkEsQUFFQyxJQUFBO0FBRlksZUFBTyxVQUVuQixDQUFBIiwiZmlsZSI6InNtYXJ0Y2xpLmNsYXNzZXMuY29tbWFuZC5qcyIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCBcInR5cGluZ3MtZ2xvYmFsXCI7XG5pbXBvcnQgKiBhcyBwbHVnaW5zIGZyb20gXCIuL3NtYXJ0Y2xpLnBsdWdpbnNcIjtcblxuZXhwb3J0IGNsYXNzIENvbW1hbmQge1xuXG59Il19
|
|
13
dist/smartcli.classes.interaction.helpers.js
vendored
13
dist/smartcli.classes.interaction.helpers.js
vendored
@ -1,7 +1,7 @@
|
|||||||
"use strict";
|
"use strict";
|
||||||
require("typings-global");
|
require("typings-global");
|
||||||
require("./smartcli.interfaces");
|
require("./smartcli.interfaces");
|
||||||
var plugins = require("./smartcli.plugins");
|
const plugins = require("./smartcli.plugins");
|
||||||
/**
|
/**
|
||||||
* executes callback with answer to question as argument
|
* executes callback with answer to question as argument
|
||||||
* @param questionString the question you want to ask the user
|
* @param questionString the question you want to ask the user
|
||||||
@ -14,7 +14,7 @@ exports.getAnswer = function (questionString, cb) {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
//make inquirer compatible question object
|
//make inquirer compatible question object
|
||||||
var question = {
|
let question = {
|
||||||
type: "input",
|
type: "input",
|
||||||
name: "userFeedback",
|
name: "userFeedback",
|
||||||
message: questionString,
|
message: questionString,
|
||||||
@ -23,7 +23,7 @@ exports.getAnswer = function (questionString, cb) {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
plugins.inquirer.prompt([question], function (answers) {
|
plugins.inquirer.prompt([question], function (answers) {
|
||||||
var answer = answers.userFeedback;
|
let answer = answers.userFeedback;
|
||||||
cb(answer);
|
cb(answer);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
@ -39,7 +39,7 @@ exports.getChoice = function (questionString, choiceOptions, cb) {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
//make inquirer compatible question object
|
//make inquirer compatible question object
|
||||||
var question = {
|
let question = {
|
||||||
type: "list",
|
type: "list",
|
||||||
name: "userFeedback",
|
name: "userFeedback",
|
||||||
message: questionString,
|
message: questionString,
|
||||||
@ -47,9 +47,8 @@ exports.getChoice = function (questionString, choiceOptions, cb) {
|
|||||||
filter: function (val) { return val.toLowerCase(); }
|
filter: function (val) { return val.toLowerCase(); }
|
||||||
};
|
};
|
||||||
plugins.inquirer.prompt(question, function (answers) {
|
plugins.inquirer.prompt(question, function (answers) {
|
||||||
var answer = answers.userFeedback;
|
let answer = answers.userFeedback;
|
||||||
cb(answer);
|
cb(answer);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic21hcnRjbGkuY2xhc3Nlcy5pbnRlcmFjdGlvbi5oZWxwZXJzLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vdHMvc21hcnRjbGkuY2xhc3Nlcy5pbnRlcmFjdGlvbi5oZWxwZXJzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFBQSxRQUFPLGdCQ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WlyZXIucHJvbXB0KHF1ZXN0aW9uLGZ1bmN0aW9uKGFuc3dlcnMpe1xuICAgICAgICBsZXQgYW5zd2VyID0gYW5zd2Vycy51c2VyRmVlZGJhY2s7XG4gICAgICAgIGNiKGFuc3dlcik7XG4gICAgfSk7XG5cbn07Il19
|
|
10
dist/smartcli.classes.interaction.js
vendored
10
dist/smartcli.classes.interaction.js
vendored
@ -1,10 +1,8 @@
|
|||||||
"use strict";
|
"use strict";
|
||||||
require("typings-global");
|
require("typings-global");
|
||||||
var Question = (function () {
|
class Question {
|
||||||
function Question() {
|
constructor() {
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return Question;
|
|
||||||
}());
|
|
||||||
exports.Question = Question;
|
exports.Question = Question;
|
||||||
|
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic21hcnRjbGkuY2xhc3Nlcy5pbnRlcmFjdGlvbi5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3RzL3NtYXJ0Y2xpLmNsYXNzZXMuaW50ZXJhY3Rpb24udHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLFFBQU8sZ0JBQWdCLENBQUMsQ0FBQTtBQUd4QjtJQUNJO0lBRUEsQ0FBQztBQUNMLENBQUM7QUFKWSxnQkFBUSxXQUlwQixDQUFBIn0=
|
||||||
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNtYXJ0Y2xpLmNsYXNzZXMuaW50ZXJhY3Rpb24udHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLFFBQU8sZ0JBQWdCLENBQUMsQ0FBQTtBQUd4QjtJQUNJO0lBRUEsQ0FBQztJQUNMLGVBQUM7QUFBRCxDQUpBLEFBSUMsSUFBQTtBQUpZLGdCQUFRLFdBSXBCLENBQUEiLCJmaWxlIjoic21hcnRjbGkuY2xhc3Nlcy5pbnRlcmFjdGlvbi5qcyIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCBcInR5cGluZ3MtZ2xvYmFsXCI7XG5pbXBvcnQgKiBhcyBwbHVnaW5zIGZyb20gXCIuL3NtYXJ0Y2xpLnBsdWdpbnNcIjtcblxuZXhwb3J0IGNsYXNzIFF1ZXN0aW9uIHtcbiAgICBjb25zdHJ1Y3Rvcigpe1xuICAgICAgICBcbiAgICB9XG59Il19
|
|
17
dist/smartcli.classes.smartcli.d.ts
vendored
17
dist/smartcli.classes.smartcli.d.ts
vendored
@ -1,4 +1,6 @@
|
|||||||
|
/// <reference types="q" />
|
||||||
import "typings-global";
|
import "typings-global";
|
||||||
|
import * as plugins from "./smartcli.plugins";
|
||||||
export declare class Smartcli {
|
export declare class Smartcli {
|
||||||
argv: any;
|
argv: any;
|
||||||
questionsDone: any;
|
questionsDone: any;
|
||||||
@ -7,10 +9,21 @@ export declare class Smartcli {
|
|||||||
questions: any;
|
questions: any;
|
||||||
version: string;
|
version: string;
|
||||||
constructor();
|
constructor();
|
||||||
|
/**
|
||||||
|
* adds an alias, meaning one equals the other in terms of triggering associated commands
|
||||||
|
*/
|
||||||
addAlias(keyArg: any, aliasArg: any): void;
|
addAlias(keyArg: any, aliasArg: any): void;
|
||||||
|
/**
|
||||||
|
* adds a Command by returning a Promise that reacts to the specific commandString given.
|
||||||
|
*
|
||||||
|
* Note: in e.g. "npm install something" the "install" is considered the command.
|
||||||
|
*/
|
||||||
addCommand(definitionArg: {
|
addCommand(definitionArg: {
|
||||||
commandName: string;
|
commandName: string;
|
||||||
}): any;
|
}): plugins.q.Promise<{}>;
|
||||||
|
/**
|
||||||
|
* gets a Promise for a command word
|
||||||
|
*/
|
||||||
getCommandPromise(commandNameArg: any): void;
|
getCommandPromise(commandNameArg: any): void;
|
||||||
addQuestion(definitionArg: {
|
addQuestion(definitionArg: {
|
||||||
questionString: string;
|
questionString: string;
|
||||||
@ -18,6 +31,6 @@ export declare class Smartcli {
|
|||||||
}): void;
|
}): void;
|
||||||
addHelp(): void;
|
addHelp(): void;
|
||||||
addVersion(versionArg: string): void;
|
addVersion(versionArg: string): void;
|
||||||
standardTask(): any;
|
standardTask(): plugins.q.Promise<{}>;
|
||||||
startParse(): void;
|
startParse(): void;
|
||||||
}
|
}
|
||||||
|
87
dist/smartcli.classes.smartcli.js
vendored
87
dist/smartcli.classes.smartcli.js
vendored
File diff suppressed because one or more lines are too long
0
dist/smartcli.interaction.d.ts
vendored
0
dist/smartcli.interaction.d.ts
vendored
3
dist/smartcli.interaction.js
vendored
3
dist/smartcli.interaction.js
vendored
@ -1,3 +0,0 @@
|
|||||||
|
|
||||||
|
|
||||||
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IiIsImZpbGUiOiJzbWFydGNsaS5pbnRlcmFjdGlvbi5qcyIsInNvdXJjZXNDb250ZW50IjpbXX0=
|
|
7
dist/smartcli.plugins.d.ts
vendored
7
dist/smartcli.plugins.d.ts
vendored
@ -1,8 +1,9 @@
|
|||||||
import "typings-global";
|
import "typings-global";
|
||||||
export declare let argv: any;
|
export declare let argv: any;
|
||||||
export declare let beautylog: any;
|
export import beautylog = require("beautylog");
|
||||||
export declare let cliff: any;
|
export declare let cliff: any;
|
||||||
export declare let inquirer: any;
|
export declare let inquirer: any;
|
||||||
|
export import lik = require("lik");
|
||||||
export declare let path: any;
|
export declare let path: any;
|
||||||
export declare let q: any;
|
export import q = require("q");
|
||||||
export declare let smartparam: any;
|
export import smartparam = require("smartparam");
|
||||||
|
4
dist/smartcli.plugins.js
vendored
4
dist/smartcli.plugins.js
vendored
@ -4,8 +4,8 @@ exports.argv = require('yargs');
|
|||||||
exports.beautylog = require("beautylog");
|
exports.beautylog = require("beautylog");
|
||||||
exports.cliff = require("cliff");
|
exports.cliff = require("cliff");
|
||||||
exports.inquirer = require("inquirer");
|
exports.inquirer = require("inquirer");
|
||||||
|
exports.lik = require("lik");
|
||||||
exports.path = require("path");
|
exports.path = require("path");
|
||||||
exports.q = require("q");
|
exports.q = require("q");
|
||||||
exports.smartparam = require("smartparam");
|
exports.smartparam = require("smartparam");
|
||||||
|
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic21hcnRjbGkucGx1Z2lucy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3RzL3NtYXJ0Y2xpLnBsdWdpbnMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLFFBQU8sZ0JBQWdCLENBQUMsQ0FBQTtBQUViLFlBQUksR0FBRyxPQUFPLENBQUMsT0FBTyxDQUFDLENBQUM7QUFDckIsaUJBQVMsV0FBVyxXQUFXLENBQUMsQ0FBQztBQUNwQyxhQUFLLEdBQUcsT0FBTyxDQUFDLE9BQU8sQ0FBQyxDQUFDO0FBQ3pCLGdCQUFRLEdBQUcsT0FBTyxDQUFDLFVBQVUsQ0FBQyxDQUFDO0FBQzVCLFdBQUcsV0FBVyxLQUFLLENBQUMsQ0FBQztBQUN4QixZQUFJLEdBQUcsT0FBTyxDQUFDLE1BQU0sQ0FBQyxDQUFDO0FBQ3BCLFNBQUMsV0FBVyxHQUFHLENBQUMsQ0FBQztBQUNqQixrQkFBVSxXQUFXLFlBQVksQ0FBQyxDQUFDIn0=
|
||||||
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNtYXJ0Y2xpLnBsdWdpbnMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLFFBQU8sZ0JBQWdCLENBQUMsQ0FBQTtBQUViLFlBQUksR0FBRyxPQUFPLENBQUMsT0FBTyxDQUFDLENBQUM7QUFDeEIsaUJBQVMsR0FBRyxPQUFPLENBQUMsV0FBVyxDQUFDLENBQUM7QUFDakMsYUFBSyxHQUFHLE9BQU8sQ0FBQyxPQUFPLENBQUMsQ0FBQztBQUN6QixnQkFBUSxHQUFHLE9BQU8sQ0FBQyxVQUFVLENBQUMsQ0FBQztBQUMvQixZQUFJLEdBQUcsT0FBTyxDQUFDLE1BQU0sQ0FBQyxDQUFDO0FBQ3ZCLFNBQUMsR0FBRyxPQUFPLENBQUMsR0FBRyxDQUFDLENBQUM7QUFDakIsa0JBQVUsR0FBRyxPQUFPLENBQUMsWUFBWSxDQUFDLENBQUMiLCJmaWxlIjoic21hcnRjbGkucGx1Z2lucy5qcyIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCBcInR5cGluZ3MtZ2xvYmFsXCI7XG5cbmV4cG9ydCBsZXQgYXJndiA9IHJlcXVpcmUoJ3lhcmdzJyk7XG5leHBvcnQgbGV0IGJlYXV0eWxvZyA9IHJlcXVpcmUoXCJiZWF1dHlsb2dcIik7XG5leHBvcnQgbGV0IGNsaWZmID0gcmVxdWlyZShcImNsaWZmXCIpO1xuZXhwb3J0IGxldCBpbnF1aXJlciA9IHJlcXVpcmUoXCJpbnF1aXJlclwiKTtcbmV4cG9ydCBsZXQgcGF0aCA9IHJlcXVpcmUoXCJwYXRoXCIpO1xuZXhwb3J0IGxldCBxID0gcmVxdWlyZShcInFcIik7XG5leHBvcnQgbGV0IHNtYXJ0cGFyYW0gPSByZXF1aXJlKFwic21hcnRwYXJhbVwiKTsiXX0=
|
|
16
package.json
16
package.json
@ -28,17 +28,19 @@
|
|||||||
},
|
},
|
||||||
"homepage": "https://gitlab.com/pushrocks/smartcli",
|
"homepage": "https://gitlab.com/pushrocks/smartcli",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"beautylog": "^5.0.12",
|
"@types/q": "0.0.30",
|
||||||
|
"beautylog": "^5.0.20",
|
||||||
"cliff": "^0.1.10",
|
"cliff": "^0.1.10",
|
||||||
"inquirer": "^1.0.3",
|
"inquirer": "^1.1.2",
|
||||||
|
"lik": "^1.0.15",
|
||||||
"q": "^1.4.1",
|
"q": "^1.4.1",
|
||||||
"smartparam": "0.0.7",
|
"smartparam": "0.1.1",
|
||||||
"typings-global": "^1.0.3",
|
"typings-global": "^1.0.6",
|
||||||
"yargs": "^4.7.1"
|
"yargs": "^5.0.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"npmts-g": "^5.2.6",
|
"npmts-g": "^5.2.8",
|
||||||
"should": "^9.0.2",
|
"should": "^11.1.0",
|
||||||
"typings-test": "^1.0.1"
|
"typings-test": "^1.0.1"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
13
test/test.js
13
test/test.js
@ -1,10 +1,10 @@
|
|||||||
"use strict";
|
"use strict";
|
||||||
require("typings-test");
|
require("typings-test");
|
||||||
var smartcli = require("../dist/index");
|
const smartcli = require("../dist/index");
|
||||||
var beautylog = require("beautylog");
|
let beautylog = require("beautylog");
|
||||||
var should = require("should");
|
let should = require("should");
|
||||||
describe("smartcli.Smartcli class", function () {
|
describe("smartcli.Smartcli class", function () {
|
||||||
var smartCliTestObject;
|
let smartCliTestObject;
|
||||||
describe("new Smartcli()", function () {
|
describe("new Smartcli()", function () {
|
||||||
it("should create a new Smartcli", function () {
|
it("should create a new Smartcli", function () {
|
||||||
smartCliTestObject = new smartcli.Smartcli();
|
smartCliTestObject = new smartcli.Smartcli();
|
||||||
@ -21,7 +21,7 @@ describe("smartcli.Smartcli class", function () {
|
|||||||
describe(".standardTask", function () {
|
describe(".standardTask", function () {
|
||||||
it("should start parsing a standardTask", function (done) {
|
it("should start parsing a standardTask", function (done) {
|
||||||
smartCliTestObject.standardTask()
|
smartCliTestObject.standardTask()
|
||||||
.then(function () {
|
.then(() => {
|
||||||
console.log("this is the standard Task!");
|
console.log("this is the standard Task!");
|
||||||
});
|
});
|
||||||
done();
|
done();
|
||||||
@ -33,5 +33,4 @@ describe("smartcli.Smartcli class", function () {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
//# sourceMappingURL=data:application/json;base64,eyJ2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AgZGVzY3JpYmUoXCIuc3RhcnRQYXJzZVwiLGZ1bmN0aW9uKCl7XG4gICAgICAgIGl0KFwic2hvdWxkIHN0YXJ0IHBhcnNpbmcgdGhlIENMSSBpbnB1dFwiLGZ1bmN0aW9uKCl7XG4gICAgICAgICAgICBzbWFydENsaVRlc3RPYmplY3Quc3RhcnRQYXJzZSgpO1xuICAgICAgICB9KVxuICAgIH0pXG59KTtcbiJdfQ==
|
|
@ -1,6 +0,0 @@
|
|||||||
import "typings-global";
|
|
||||||
import * as plugins from "./smartcli.plugins";
|
|
||||||
|
|
||||||
export class Command {
|
|
||||||
|
|
||||||
}
|
|
@ -14,10 +14,20 @@ export class Smartcli {
|
|||||||
this.argv = plugins.argv;
|
this.argv = plugins.argv;
|
||||||
this.questionsDone = plugins.q.defer();
|
this.questionsDone = plugins.q.defer();
|
||||||
this.parseStarted = plugins.q.defer();
|
this.parseStarted = plugins.q.defer();
|
||||||
}
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* adds an alias, meaning one equals the other in terms of triggering associated commands
|
||||||
|
*/
|
||||||
addAlias(keyArg,aliasArg){
|
addAlias(keyArg,aliasArg){
|
||||||
this.argv = this.argv.alias(keyArg,aliasArg);
|
this.argv = this.argv.alias(keyArg,aliasArg);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* adds a Command by returning a Promise that reacts to the specific commandString given.
|
||||||
|
*
|
||||||
|
* Note: in e.g. "npm install something" the "install" is considered the command.
|
||||||
|
*/
|
||||||
addCommand(definitionArg:{commandName:string}){
|
addCommand(definitionArg:{commandName:string}){
|
||||||
let done = plugins.q.defer();
|
let done = plugins.q.defer();
|
||||||
this.parseStarted.promise
|
this.parseStarted.promise
|
||||||
@ -30,6 +40,10 @@ export class Smartcli {
|
|||||||
});
|
});
|
||||||
return done.promise;
|
return done.promise;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* gets a Promise for a command word
|
||||||
|
*/
|
||||||
getCommandPromise(commandNameArg){
|
getCommandPromise(commandNameArg){
|
||||||
//TODO
|
//TODO
|
||||||
}
|
}
|
||||||
|
@ -1,9 +1,10 @@
|
|||||||
import "typings-global";
|
import "typings-global";
|
||||||
|
|
||||||
export let argv = require('yargs');
|
export let argv = require('yargs');
|
||||||
export let beautylog = require("beautylog");
|
export import beautylog = require("beautylog");
|
||||||
export let cliff = require("cliff");
|
export let cliff = require("cliff");
|
||||||
export let inquirer = require("inquirer");
|
export let inquirer = require("inquirer");
|
||||||
|
export import lik = require("lik");
|
||||||
export let path = require("path");
|
export let path = require("path");
|
||||||
export let q = require("q");
|
export import q = require("q");
|
||||||
export let smartparam = require("smartparam");
|
export import smartparam = require("smartparam");
|
Loading…
Reference in New Issue
Block a user