standard tasks now returns argv
This commit is contained in:
parent
63a9da11be
commit
016f03bd8a
3
dist/smartcli.classes.command.d.ts
vendored
Normal file
3
dist/smartcli.classes.command.d.ts
vendored
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
import "typings-global";
|
||||||
|
export declare class Command {
|
||||||
|
}
|
10
dist/smartcli.classes.command.js
vendored
Normal file
10
dist/smartcli.classes.command.js
vendored
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
"use strict";
|
||||||
|
require("typings-global");
|
||||||
|
var Command = (function () {
|
||||||
|
function Command() {
|
||||||
|
}
|
||||||
|
return Command;
|
||||||
|
}());
|
||||||
|
exports.Command = Command;
|
||||||
|
|
||||||
|
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNtYXJ0Y2xpLmNsYXNzZXMuY29tbWFuZC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBQUEsUUFBTyxnQkFBZ0IsQ0FBQyxDQUFBO0FBR3hCO0lBQUE7SUFFQSxDQUFDO0lBQUQsY0FBQztBQUFELENBRkEsQUFFQyxJQUFBO0FBRlksZUFBTyxVQUVuQixDQUFBIiwiZmlsZSI6InNtYXJ0Y2xpLmNsYXNzZXMuY29tbWFuZC5qcyIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCBcInR5cGluZ3MtZ2xvYmFsXCI7XG5pbXBvcnQgKiBhcyBwbHVnaW5zIGZyb20gXCIuL3NtYXJ0Y2xpLnBsdWdpbnNcIjtcblxuZXhwb3J0IGNsYXNzIENvbW1hbmQge1xuXG59Il19
|
4
dist/smartcli.classes.interaction.d.ts
vendored
Normal file
4
dist/smartcli.classes.interaction.d.ts
vendored
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
import "typings-global";
|
||||||
|
export declare class Question {
|
||||||
|
constructor();
|
||||||
|
}
|
17
dist/smartcli.classes.interaction.helpers.d.ts
vendored
Normal file
17
dist/smartcli.classes.interaction.helpers.d.ts
vendored
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
import "typings-global";
|
||||||
|
import "./smartcli.interfaces";
|
||||||
|
/**
|
||||||
|
* executes callback with answer to question as argument
|
||||||
|
* @param questionString the question you want to ask the user
|
||||||
|
* @param cb the function to execute with answer as param
|
||||||
|
* @returns {null}
|
||||||
|
*/
|
||||||
|
export declare let getAnswer: (questionString: string, cb: any) => any;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param questionString
|
||||||
|
* @param choiceOptions
|
||||||
|
* @param cb
|
||||||
|
* @returns {null}
|
||||||
|
*/
|
||||||
|
export declare let getChoice: (questionString: string, choiceOptions: string[], cb: any) => any;
|
55
dist/smartcli.classes.interaction.helpers.js
vendored
Normal file
55
dist/smartcli.classes.interaction.helpers.js
vendored
Normal file
@ -0,0 +1,55 @@
|
|||||||
|
"use strict";
|
||||||
|
require("typings-global");
|
||||||
|
require("./smartcli.interfaces");
|
||||||
|
var plugins = require("./smartcli.plugins");
|
||||||
|
/**
|
||||||
|
* executes callback with answer to question as argument
|
||||||
|
* @param questionString the question you want to ask the user
|
||||||
|
* @param cb the function to execute with answer as param
|
||||||
|
* @returns {null}
|
||||||
|
*/
|
||||||
|
exports.getAnswer = function (questionString, cb) {
|
||||||
|
if (typeof questionString != 'string') {
|
||||||
|
plugins.beautylog.error('no question specified');
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
//make inquirer compatible question object
|
||||||
|
var question = {
|
||||||
|
type: "input",
|
||||||
|
name: "userFeedback",
|
||||||
|
message: questionString,
|
||||||
|
validate: function (value) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
plugins.inquirer.prompt([question], function (answers) {
|
||||||
|
var answer = answers.userFeedback;
|
||||||
|
cb(answer);
|
||||||
|
});
|
||||||
|
};
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param questionString
|
||||||
|
* @param choiceOptions
|
||||||
|
* @param cb
|
||||||
|
* @returns {null}
|
||||||
|
*/
|
||||||
|
exports.getChoice = function (questionString, choiceOptions, cb) {
|
||||||
|
if (!Array.isArray(choiceOptions)) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
//make inquirer compatible question object
|
||||||
|
var question = {
|
||||||
|
type: "list",
|
||||||
|
name: "userFeedback",
|
||||||
|
message: questionString,
|
||||||
|
choices: choiceOptions,
|
||||||
|
filter: function (val) { return val.toLowerCase(); }
|
||||||
|
};
|
||||||
|
plugins.inquirer.prompt(question, function (answers) {
|
||||||
|
var answer = answers.userFeedback;
|
||||||
|
cb(answer);
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNtYXJ0Y2xpLmNsYXNzZXMuaW50ZXJhY3Rpb24uaGVscGVycy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBQUEsUUFBTyxnQkFBZ0IsQ0FBQyxDQUFBO0FBRXhCLFFBQU8sdUJBQXVCLENBQUMsQ0FBQTtBQUMvQixJQUFPLE9BQU8sV0FBVyxvQkFBb0IsQ0FBQyxDQUFDO0FBRS9DOzs7OztHQUtHO0FBQ1EsaUJBQVMsR0FBRyxVQUFTLGNBQXFCLEVBQUUsRUFBRTtJQUNyRCxFQUFFLENBQUMsQ0FBQyxPQUFPLGNBQWMsSUFBSSxRQUFRLENBQUMsQ0FBQyxDQUFDO1FBQ3BDLE9BQU8sQ0FBQyxTQUFTLENBQUMsS0FBSyxDQUFDLHVCQUF1QixDQUFDLENBQUM7UUFDakQsTUFBTSxDQUFDLElBQUksQ0FBQztJQUNoQixDQUFDO0lBQ0QsMENBQTBDO0lBQzFDLElBQUksUUFBUSxHQUFHO1FBQ1gsSUFBSSxFQUFFLE9BQU87UUFDYixJQUFJLEVBQUUsY0FBYztRQUNwQixPQUFPLEVBQUUsY0FBYztRQUN2QixRQUFRLEVBQUUsVUFBVSxLQUFLO1lBQ3JCLE1BQU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dist/smartcli.classes.interaction.js
vendored
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
"use strict";
|
||||||
|
require("typings-global");
|
||||||
|
var Question = (function () {
|
||||||
|
function Question() {
|
||||||
|
}
|
||||||
|
return Question;
|
||||||
|
}());
|
||||||
|
exports.Question = Question;
|
||||||
|
|
||||||
|
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNtYXJ0Y2xpLmNsYXNzZXMuaW50ZXJhY3Rpb24udHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLFFBQU8sZ0JBQWdCLENBQUMsQ0FBQTtBQUd4QjtJQUNJO0lBRUEsQ0FBQztJQUNMLGVBQUM7QUFBRCxDQUpBLEFBSUMsSUFBQTtBQUpZLGdCQUFRLFdBSXBCLENBQUEiLCJmaWxlIjoic21hcnRjbGkuY2xhc3Nlcy5pbnRlcmFjdGlvbi5qcyIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCBcInR5cGluZ3MtZ2xvYmFsXCI7XG5pbXBvcnQgKiBhcyBwbHVnaW5zIGZyb20gXCIuL3NtYXJ0Y2xpLnBsdWdpbnNcIjtcblxuZXhwb3J0IGNsYXNzIFF1ZXN0aW9uIHtcbiAgICBjb25zdHJ1Y3Rvcigpe1xuICAgICAgICBcbiAgICB9XG59Il19
|
1
dist/smartcli.classes.smartcli.d.ts
vendored
1
dist/smartcli.classes.smartcli.d.ts
vendored
@ -15,6 +15,7 @@ export declare class Smartcli {
|
|||||||
questionString: string;
|
questionString: string;
|
||||||
questionType: string;
|
questionType: string;
|
||||||
}): void;
|
}): void;
|
||||||
|
addHelp(): void;
|
||||||
addVersion(versionArg: string): void;
|
addVersion(versionArg: string): void;
|
||||||
standardTask(): any;
|
standardTask(): any;
|
||||||
startParse(): void;
|
startParse(): void;
|
||||||
|
10
dist/smartcli.classes.smartcli.js
vendored
10
dist/smartcli.classes.smartcli.js
vendored
File diff suppressed because one or more lines are too long
17
dist/smartcli.interaction.d.ts
vendored
17
dist/smartcli.interaction.d.ts
vendored
@ -1,17 +0,0 @@
|
|||||||
import "typings-global";
|
|
||||||
import "./smartcli.interfaces";
|
|
||||||
/**
|
|
||||||
* executes callback with answer to question as argument
|
|
||||||
* @param questionString the question you want to ask the user
|
|
||||||
* @param cb the function to execute with answer as param
|
|
||||||
* @returns {null}
|
|
||||||
*/
|
|
||||||
export declare let getAnswer: (questionString: string, cb: any) => any;
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @param questionString
|
|
||||||
* @param choiceOptions
|
|
||||||
* @param cb
|
|
||||||
* @returns {null}
|
|
||||||
*/
|
|
||||||
export declare let getChoice: (questionString: string, choiceOptions: string[], cb: any) => any;
|
|
56
dist/smartcli.interaction.js
vendored
56
dist/smartcli.interaction.js
vendored
@ -1,55 +1,3 @@
|
|||||||
"use strict";
|
|
||||||
require("typings-global");
|
|
||||||
require("./smartcli.interfaces");
|
|
||||||
var plugins = require("./smartcli.plugins");
|
|
||||||
/**
|
|
||||||
* executes callback with answer to question as argument
|
|
||||||
* @param questionString the question you want to ask the user
|
|
||||||
* @param cb the function to execute with answer as param
|
|
||||||
* @returns {null}
|
|
||||||
*/
|
|
||||||
exports.getAnswer = function (questionString, cb) {
|
|
||||||
if (typeof questionString != 'string') {
|
|
||||||
plugins.beautylog.error('no question specified');
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
//make inquirer compatible question object
|
|
||||||
var question = {
|
|
||||||
type: "input",
|
|
||||||
name: "userFeedback",
|
|
||||||
message: questionString,
|
|
||||||
validate: function (value) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
plugins.inquirer.prompt([question], function (answers) {
|
|
||||||
var answer = answers.userFeedback;
|
|
||||||
cb(answer);
|
|
||||||
});
|
|
||||||
};
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @param questionString
|
|
||||||
* @param choiceOptions
|
|
||||||
* @param cb
|
|
||||||
* @returns {null}
|
|
||||||
*/
|
|
||||||
exports.getChoice = function (questionString, choiceOptions, cb) {
|
|
||||||
if (!Array.isArray(choiceOptions)) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
//make inquirer compatible question object
|
|
||||||
var question = {
|
|
||||||
type: "list",
|
|
||||||
name: "userFeedback",
|
|
||||||
message: questionString,
|
|
||||||
choices: choiceOptions,
|
|
||||||
filter: function (val) { return val.toLowerCase(); }
|
|
||||||
};
|
|
||||||
plugins.inquirer.prompt(question, function (answers) {
|
|
||||||
var answer = answers.userFeedback;
|
|
||||||
cb(answer);
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNtYXJ0Y2xpLmludGVyYWN0aW9uLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFBQSxRQUFPLGdCQUFnQixDQUFDLENBQUE7QUFFeEIsUUFBTyx1QkFBdUIsQ0FBQyxDQUFBO0FBQy9CLElBQU8sT0FBTyxXQUFXLG9CQUFvQixDQUFDLENBQUM7QUFFL0M7Ozs7O0dBS0c7QUFDUSxpQkFBUyxHQUFHLFVBQVMsY0FBcUIsRUFBRSxFQUFFO0lBQ3JELEVBQUUsQ0FBQyxDQUFDLE9BQU8sY0FBYyxJQUFJLFFBQVEsQ0FBQyxDQUFDLENBQUM7UUFDcEMsT0FBTyxDQUFDLFNBQVMsQ0FBQyxLQUFLLENBQUMsdUJBQXVCLENBQUMsQ0FBQztRQUNqRCxNQUFNLENBQUMsSUFBSSxDQUFDO0lBQ2hCLENBQUM7SUFDRCwwQ0FBMEM7SUFDMUMsSUFBSSxRQUFRLEdBQUc7UUFDWCxJQUFJLEVBQUUsT0FBTztRQUNiLElBQUksRUFBRSxjQUFjO1FBQ3BCLE9BQU8sRUFBRSxjQUFjO1FBQ3ZCLFFBQVEsRUFBRSxVQUFVLEtBQUs7WUFDckIsTUFBTSxD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5xdWlyZXIucHJvbXB0KFtxdWVzdGlvbl0sZnVuY3Rpb24oYW5zd2Vycyl7XG4gICAgICAgIGxldCBhbnN3ZXIgPSBhbnN3ZXJzLnVzZXJGZWVkYmFjaztcbiAgICAgICAgY2IoYW5zd2VyKTtcbiAgICB9KTtcbn07XG5cbi8qKlxuICpcbiAqIEBwYXJhbSBxdWVzdGlvblN0cmluZ1xuICogQHBhcmFtIGNob2ljZU9wdGlvbnNcbiAqIEBwYXJhbSBjYlxuICogQHJldHVybnMge251bGx9XG4gKi9cbmV4cG9ydCBsZXQgZ2V0Q2hvaWNlID0gZnVuY3Rpb24ocXVlc3Rpb25TdHJpbmc6c3RyaW5nLCBjaG9pY2VPcHRpb25zOnN0cmluZ1tdLCBjYikge1xuICAgIGlmKCFBcnJheS5pc0FycmF5KGNob2ljZU9wdGlvbnMpKSB7XG4gICAgICAgIHJldHVybiBudWxsO1xuICAgIH1cblxuICAgIC8vbWFrZSBpbnF1aXJlciBjb21wYXRpYmxlIHF1ZXN0aW9uIG9iamVjdFxuICAgIGxldCBxdWVzdGlvbiA9IHtcbiAgICAgICAgdHlwZTogXCJsaXN0XCIsXG4gICAgICAgIG5hbWU6IFwidXNlckZlZWRiYWNrXCIsXG4gICAgICAgIG1lc3NhZ2U6IHF1ZXN0aW9uU3RyaW5nLFxuICAgICAgICBjaG9pY2VzOiBjaG9pY2VPcHRpb25zLFxuICAgICAgICBmaWx0ZXI6IGZ1bmN0aW9uKCB2YWwgKSB7IHJldHVybiB2YWwudG9Mb3dlckNhc2UoKTsgfVxuICAgIH07XG5cbiAgICBwbHVnaW5zLmlucXVpcmVyLnByb21wdChxdWVzdGlvbixmdW5jdGlvbihhbnN3ZXJzKXtcbiAgICAgICAgbGV0IGFuc3dlciA9IGFuc3dlcnMudXNlckZlZWRiYWNrO1xuICAgICAgICBjYihhbnN3ZXIpO1xuICAgIH0pO1xuXG59OyJdfQ==
|
|
||||||
|
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IiIsImZpbGUiOiJzbWFydGNsaS5pbnRlcmFjdGlvbi5qcyIsInNvdXJjZXNDb250ZW50IjpbXX0=
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
import "typings-global";
|
import "typings-global";
|
||||||
import * as plugins from "./smartcli.plugins";
|
import * as plugins from "./smartcli.plugins";
|
||||||
|
|
||||||
export class Command {
|
export class Question {
|
||||||
|
constructor(){
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
@ -1,7 +1,7 @@
|
|||||||
import "typings-global";
|
import "typings-global";
|
||||||
|
|
||||||
import * as plugins from "./smartcli.plugins";
|
import * as plugins from "./smartcli.plugins";
|
||||||
import * as SmartcliInteractions from "./smartcli.interaction";
|
import {Question} from "./smartcli.classes.interaction";
|
||||||
|
|
||||||
export class Smartcli {
|
export class Smartcli {
|
||||||
argv;
|
argv;
|
||||||
@ -51,9 +51,9 @@ export class Smartcli {
|
|||||||
this.parseStarted.promise
|
this.parseStarted.promise
|
||||||
.then(() => {
|
.then(() => {
|
||||||
if(this.argv._.length == 0 && !this.argv.v){
|
if(this.argv._.length == 0 && !this.argv.v){
|
||||||
done.resolve();
|
done.resolve(this.argv);
|
||||||
} else {
|
} else {
|
||||||
done.reject();
|
done.reject(this.argv);
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
return done.promise;
|
return done.promise;
|
||||||
|
Loading…
Reference in New Issue
Block a user