Skip to content

Commit 69323fa

Browse files
committed
update readme
1 parent 39a978e commit 69323fa

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,7 @@ short form).
238238
`arg` | If the flag requires an argument, specify its name here.
239239
`required` | Specify if this flag is required.
240240
`default` | The value to use in case it is not provided by the user. Implies that this flag is optional, and only makes sense when the flag has an argument.
241+
`allowed` | For flags with an argument, you can limit the allowed values by providing an array.
241242

242243
#### Special handling for -v and -h
243244

lib/bashly/views/flag/case.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<%- if allowed -%>
99
allowed="<%= allowed.join '|' %>"
1010
if [[ ! ${args[<%= name %>]} =~ $allowed ]]; then
11-
printf "%s\n" "<%= strings[:disallowed_flag] % { name: name, allowed: allowed.join(', ') } %>\n"
11+
printf "%s\n" "<%= strings[:disallowed_flag] % { name: name, allowed: allowed.join(', ') } %>"
1212
exit 1
1313
fi
1414
<%- end -%>

0 commit comments

Comments
 (0)