diff --git a/dist/smartcli.classes.smartcli.js b/dist/smartcli.classes.smartcli.js index f78c3ae..648a746 100644 --- a/dist/smartcli.classes.smartcli.js +++ b/dist/smartcli.classes.smartcli.js @@ -17,7 +17,7 @@ var Smartcli = (function () { this.parseStarted.promise .then(function () { if (_this.argv._.indexOf(definitionArg.commandName) == 0) { - done.resolve(); + done.resolve(_this.argv); } else { return done.reject(); @@ -45,7 +45,7 @@ var Smartcli = (function () { var done = plugins.q.defer(); this.parseStarted.promise .then(function () { - if (_this.argv._.length == 0 || !_this.argv.v) { + if (_this.argv._.length == 0 && !_this.argv.v) { done.resolve(); } else { @@ -63,4 +63,4 @@ var Smartcli = (function () { }()); exports.Smartcli = Smartcli; -//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNtYXJ0Y2xpLmNsYXNzZXMuc21hcnRjbGkudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLFFBQU8sZ0JBQWdCLENBQUMsQ0FBQTtBQUV4QixJQUFZLE9BQU8sV0FBTSxvQkFDekIsQ0FBQyxDQUQ0QztBQUc3QztJQU9JO1FBQ0ksSUFBSSxDQUFDLElBQUksR0FBRyxPQUFPLENBQUMsSUFBSSxDQUFDO1FBQ3pCLElBQUksQ0FBQyxhQUFhLEdBQUcsT0FBTyxDQUFDLENBQUMsQ0FBQyxLQUFLLEVBQUUsQ0FBQztRQUN2QyxJQUFJLENBQUMsWUFBWSxHQUFHLE9BQU8sQ0FBQyxDQUFDLENBQUMsS0FBSyxFQUFFLENBQUM7SUFDMUMsQ0FBQztJQUNELDJCQUFRLEdBQVIsVUFBUyxNQUFNLEVBQUMsUUFBUTtRQUNwQixJQUFJLENBQUMsSUFBSSxHQUFHLElBQUksQ0FBQyxJQUFJLENBQUMsS0FBSyxDQUFDLE1BQU0sRUFBQyxRQUFRLENBQUMsQ0FBQztJQUNqRCxDQUFDOztJQUNELDZCQUFVLEdBQVYsVUFBV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dGlvblN0cmluZzpzdHJpbmcscXVlc3Rpb25UeXBlOnN0cmluZ30pe1xuICAgICAgICBcbiAgICB9O1xuICAgIGFkZFZlcnNpb24odmVyc2lvbkFyZzpzdHJpbmcpe1xuICAgICAgICB0aGlzLnZlcnNpb24gPSB2ZXJzaW9uQXJnO1xuICAgICAgICB0aGlzLmFkZEFsaWFzKFwidlwiLFwidmVyc2lvblwiKTtcbiAgICAgICAgdGhpcy5wYXJzZVN0YXJ0ZWQucHJvbWlzZVxuICAgICAgICAgICAgLnRoZW4oKCkgPT4ge1xuICAgICAgICAgICAgICAgIGlmKHRoaXMuYXJndi52KXtcbiAgICAgICAgICAgICAgICAgICAgY29uc29sZS5sb2codGhpcy52ZXJzaW9uKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9KVxuICAgIH1cbiAgICBzdGFuZGFyZFRhc2soKXtcbiAgICAgICAgbGV0IGRvbmUgPSBwbHVnaW5zLnEuZGVmZXIoKTtcbiAgICAgICAgdGhpcy5wYXJzZVN0YXJ0ZWQucHJvbWlzZVxuICAgICAgICAgICAgLnRoZW4oKCkgPT4ge1xuICAgICAgICAgICAgICAgIGlmKHRoaXMuYXJndi5fLmxlbmd0aCA9PSAwIHx8ICF0aGlzLmFyZ3Yudil7XG4gICAgICAgICAgICAgICAgICAgIGRvbmUucmVzb2x2ZSgpO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIGRvbmUucmVqZWN0KCk7XG4gICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIH0pO1xuICAgICAgICByZXR1cm4gZG9uZS5wcm9taXNlO1xuICAgIH1cbiAgICBzdGFydFBhcnNlKCl7XG4gICAgICAgIHRoaXMuYXJndiA9IHRoaXMuYXJndi5hcmd2O1xuICAgICAgICB0aGlzLnBhcnNlU3RhcnRlZC5yZXNvbHZlKCk7XG4gICAgfVxuXG59Il19 +//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2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jb25zb2xlLmxvZyh0aGlzLnZlcnNpb24pO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0pXG4gICAgfVxuICAgIHN0YW5kYXJkVGFzaygpe1xuICAgICAgICBsZXQgZG9uZSA9IHBsdWdpbnMucS5kZWZlcigpO1xuICAgICAgICB0aGlzLnBhcnNlU3RhcnRlZC5wcm9taXNlXG4gICAgICAgICAgICAudGhlbigoKSA9PiB7XG4gICAgICAgICAgICAgICAgaWYodGhpcy5hcmd2Ll8ubGVuZ3RoID09IDAgJiYgIXRoaXMuYXJndi52KXtcbiAgICAgICAgICAgICAgICAgICAgZG9uZS5yZXNvbHZlKCk7XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgZG9uZS5yZWplY3QoKTtcbiAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgfSk7XG4gICAgICAgIHJldHVybiBkb25lLnByb21pc2U7XG4gICAgfVxuICAgIHN0YXJ0UGFyc2UoKXtcbiAgICAgICAgdGhpcy5hcmd2ID0gdGhpcy5hcmd2LmFyZ3Y7XG4gICAgICAgIHRoaXMucGFyc2VTdGFydGVkLnJlc29sdmUoKTtcbiAgICB9XG5cbn0iXX0= diff --git a/ts/smartcli.classes.smartcli.ts b/ts/smartcli.classes.smartcli.ts index cfbed5c..f2a5a95 100644 --- a/ts/smartcli.classes.smartcli.ts +++ b/ts/smartcli.classes.smartcli.ts @@ -47,7 +47,7 @@ export class Smartcli { let done = plugins.q.defer(); this.parseStarted.promise .then(() => { - if(this.argv._.length == 0 || !this.argv.v){ + if(this.argv._.length == 0 && !this.argv.v){ done.resolve(); } else { done.reject();