mirror of
https://github.com/serverless/serverless.git
synced 2026-02-01 16:07:28 +00:00
generate help when no commands are provided
This commit is contained in:
parent
b4d2cd4363
commit
00e099152f
@ -125,9 +125,8 @@ class Serverless {
|
||||
command(argv) {
|
||||
|
||||
SUtils.sDebug('command argv', argv);
|
||||
|
||||
// Handle version command
|
||||
if (argv.version) {
|
||||
if (argv._[0] === 'version') {
|
||||
console.log(this._version);
|
||||
return BbPromise.resolve();
|
||||
}
|
||||
@ -137,7 +136,7 @@ class Serverless {
|
||||
|
||||
this.cli = {}; //options and args that the command was called with on the CLI so plugins can leverage
|
||||
|
||||
if (argv.help || argv.h) {
|
||||
if (argv._.length === 0 || argv._[0] === 'help' || argv._[0] === 'h') {
|
||||
if (!this.commands[cmdContext]) {
|
||||
return SCli.generateMainHelp(this.commands);
|
||||
} else if (this.commands[cmdContext] && !this.commands[cmdContext][cmdContextAction]) {
|
||||
|
||||
@ -12,7 +12,7 @@ describe('All Tests', function() {
|
||||
after(function() {});
|
||||
|
||||
//require('./tests/actions/TestPluginCustom');
|
||||
//require('./tests/actions/TestDefaultActionHook');
|
||||
require('./tests/actions/TestDefaultActionHook');
|
||||
//require('./tests/actions/ProjectCreate');
|
||||
//require('./tests/actions/StageCreate');
|
||||
//require('./tests/actions/RegionCreate');
|
||||
@ -23,7 +23,7 @@ describe('All Tests', function() {
|
||||
//require('./tests/actions/EnvGet');
|
||||
//require('./tests/actions/EnvSetUnset');
|
||||
//require('./tests/actions/ResourcesDeploy');
|
||||
require('./tests/actions/FunctionRun');
|
||||
//require('./tests/actions/FunctionRun');
|
||||
//require('./tests/actions/FunctionDeploy');
|
||||
|
||||
});
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user