Skip to content

Commit

Permalink
fix(yaro): support nested flag dot notation
Browse files Browse the repository at this point in the history
Signed-off-by: Charlike Mike Reagent <opensource@tunnckocore.com>
  • Loading branch information
tunnckoCore committed Mar 6, 2020
1 parent 13d43a6 commit 99329c6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions modules/yaro/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
},
"scripts": {},
"dependencies": {
"dset": "^2.0.1",
"mri": "^1.1.4"
},
"keywords": [
Expand Down
6 changes: 5 additions & 1 deletion modules/yaro/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
'use strict';

const parseArgv = require('mri');
const dset = require('dset');

const { cwd, exit } = process;
const processEnv = process.env;
Expand Down Expand Up @@ -554,7 +555,10 @@ class Yaro {
const rawArgs = parsed._.slice();
delete parsed._;

const flags = { ...parsed };
const flags = Object.keys({ ...parsed }).reduce((acc, key) => {
dset(acc, key, acc[key] === undefined ? true : acc[key]);
return acc;
}, {});

const cmdName = this.settings.singleMode
? '$$root'
Expand Down

0 comments on commit 99329c6

Please sign in to comment.