Skip to content

Commit

Permalink
Added ability to retrieve named flag using metadata flag() method.
Browse files Browse the repository at this point in the history
  • Loading branch information
coreybutler committed May 4, 2020
1 parent d578773 commit 057913d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@author.io/shell",
"version": "1.5.2",
"version": "1.5.3",
"description": "A micro-framework for creating CLI-like experiences. This supports Node.js and browsers.",
"main": "src/index.js",
"scripts": {
Expand Down
4 changes: 4 additions & 0 deletions src/command.js
Original file line number Diff line number Diff line change
Expand Up @@ -402,6 +402,10 @@ export default class Command extends Base {
return pdata.flagSource[name].value
}
} catch (e) {
if (this.arguments.has(name)) {
return Array.from(parser.unrecognizedFlags)[args.indexOf(name)]
}

return undefined
}
}
Expand Down

0 comments on commit 057913d

Please sign in to comment.