Skip to content

Commit 4a25411

Browse files
author
Ben Gowers
committed
added processing for unknown args
1 parent 846f2cb commit 4a25411

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

src/index.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,11 @@ program
3333
.option("--sam", "use the SAM framework to execute commands")
3434
.option("-c, --ci", "ci mode for sls-dev-guardian checks")
3535
.option("--mfa <mfa>", "mfa token for profiles with mfa authentication")
36+
.ignoreUnknownOptions()
3637
.parse(process.argv);
3738

3839
program.location = program.location || process.cwd();
39-
const SLS = new Serverless(program.location);
40+
const SLS = new Serverless(program);
4041
if (!program.stage) {
4142
program.stage = SLS.getStage();
4243
}

src/services/serverless.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
1+
import transformArgsToDict from "../utils/transformArgsToDict";
2+
13
const fs = require("fs");
24
const path = require("path");
35
const YAML = require("js-yaml");
46

57
class Serverless {
6-
constructor(location) {
8+
constructor(program) {
9+
const { argv, location } = program;
10+
const options = transformArgsToDict(argv);
711
const ymlPath = path.join(location, "serverless.yml");
812
const yamlPath = path.join(location, "serverless.yaml");
913
const jsonPath = path.join(location, "serverless.json");

0 commit comments

Comments
 (0)