Skip to content

Commit

Permalink
chore: update readme and examples
Browse files Browse the repository at this point in the history
  • Loading branch information
sigoden committed Mar 13, 2023
1 parent ae4a97d commit 3abc2d6
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 15 deletions.
24 changes: 12 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,11 +116,11 @@ Define a positional argument.
# @arg arg3* A positional argument support multiple values
# @arg arg4+ A required positional argument support multiple values
# @arg arg5=a A positional argument with default value
# @arg arg6[a|b] A positional argument with choices
# @arg arg7[=a|b] A positional argument with choices and default value
# @arg arg8![a|b] A required positional argument with choices
# @arg arg9=`_fn` A positional argument with defaulf value from fn
# @arg arg10[`_fn`] A positional argument with choices from fn
# @arg arg6=`_fn` A positional argument with default value from fn
# @arg arg7[a|b] A positional argument with choices
# @arg arg8[`_fn`] A positional argument with choices from fn
# @arg arg9[=a|b] A positional argument with choices and default value
# @arg arg10![a|b] A required positional argument with choices
# @arg arg11![`_fn`] A required positional argument with choices from fn
```

Expand All @@ -140,13 +140,13 @@ Define a option.
# @option --opt5* A option with multiple values
# @option --opt6+ A required option with multiple values
# @option --opt7=a A option with default value
# @option --opt8[a|b] A option with choices
# @option --opt9[=a|b] A option with choices and default value
# @option --opt10![a|b] A required option with choices
# @option -b --opt11 <PATH> A option with short alias and notation
# @option --opt12=`_fn` A option with default value from fn
# @option --opt13[`_fn`] A option with choices from fn
# @option --opt14![`_fn`] A required option with choices from fn
# @option --opt8=`_fn` A option with default value from fn
# @option --opt9[a|b] A option with choices
# @option --opt10[`_fn`] A option with choices from fn
# @option --opt11[=a|b] A option with choices and default value
# @option --opt12![a|b] A required option with choices
# @option --opt13![`_fn`] A required option with choices from fn
# @option -b --opt14 <PATH> A option with short alias and notation
```

### @flag
Expand Down
16 changes: 13 additions & 3 deletions examples/options.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,19 @@
# @option -c --opt3* A option with multiple values
# @option -d --opt4+ A required option with multiple values
# @option -e --opt5=a A option with default value
# @option -x --opt6[x|y|z] A option with choices
# @option -y --opt7[=x|y|z] A option with choices and default value
# @option -z --opt8![x|y|z] A required option with choices
# @option -f --opt6=`_fn` A option with default value from fn
# @option -x --opt7[x|y|z] A option with choices
# @option -y --opt8[=x|y|z] A option with choices and default value
# @option -z --opt9![x|y|z] A required option with choices
# @option --opt10[`_fn2`] A option with choices from fn

_fn() {
echo abc
}

_fn2() {
echo "x y z"
}

eval "$(argc "$0" "$@")"

Expand Down

0 comments on commit 3abc2d6

Please sign in to comment.