-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: make build scripts compatible with Bash strict mode (#329)
* add default empty to work with strict mode * fix _argc_take_args expansion and bump version * Add nounset option for tests and fix expansions * refactor tests * fix _argc_validate_choices * skip tests --------- Co-authored-by: Ken Johnson <[email protected]> Co-authored-by: sigoden <[email protected]>
- Loading branch information
1 parent
fb14645
commit b073e36
Showing
4 changed files
with
69 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -eu | ||
|
||
|
||
# @flag --fa | ||
# @option --oa | ||
# @option --of*, multi-occurs + comma-separated list | ||
# @option --oda=a default | ||
# @option --oca[a|b] choice | ||
# @option --ofa[`_choice_fn`] choice from fn | ||
# @option --oxa~ capture all remaining args | ||
|
||
main() { | ||
( set -o posix ; set ) | grep ^argc_ | ||
echo "${argc__fn:-}" "$@" | ||
} | ||
|
||
_choice_fn() { | ||
echo abc | ||
echo def | ||
echo ghi | ||
} | ||
|
||
eval "$(argc --argc-eval "$0" "$@")" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters