Skip to content

Commit

Permalink
fix: default value was not assigned
Browse files Browse the repository at this point in the history
Closes #54
  • Loading branch information
ifedchankau authored and itekaf committed Jul 26, 2018
1 parent 938d85c commit 1d043a3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/argumentsFill.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ const setArgument = (section, argument) => {
const setDescription = (section, argument) => {
argument.description = section;
// TODO: add other patterns for default value parsing
const defaultValues = section.match(/\[default: (.*?)\]/i);
const regularExp = new RegExp('\\[default: (.*?)\\]', 'gim');
const defaultValues = regularExp.exec(section);
if (defaultValues) {
argument.defaultValue = defaultValues[1];
argument.isFlag = false;
Expand Down
2 changes: 1 addition & 1 deletion src/templatizer.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ const templatizer = (context) => {
// TODO: argument types
}
optionSchema.description = option.description;
optionSchema.default = option.default;
optionSchema.default = option.defaultValues;
result.definitions.arguments.properties[argumentName] = optionSchema;
});

Expand Down

0 comments on commit 1d043a3

Please sign in to comment.