* +argc

* test
This commit is contained in:
Jacob Heider 2024-03-22 13:22:30 -04:00 committed by GitHub
parent ed57969d9e
commit 65ce9493b7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -0,0 +1,35 @@
distributable:
url: https://github.com/sigoden/argc/archive/refs/tags/{{ version.tag }}.tar.gz
strip-components: 1
provides:
- bin/argc
versions:
github: sigoden/argc
strip: /v/
build:
dependencies:
rust-lang.org: '>=1.56'
rust-lang.org/cargo: '*'
script: cargo install --locked --path . --root {{prefix}}
test:
- test "$(argc --argc-version)" = "argc {{version}}"
- run: cat $FIXTURE && bash $FIXTURE -F --bar=xyz --baz a --baz b v1 v2 >test.out
fixture: |
# @flag -F --foo Flag value
# @option --bar Option value
# @option --baz* Option values
# @arg val* Positional values
eval "$(argc --argc-eval "$0" "$@")"
echo foo: $argc_foo
echo bar: $argc_bar
echo baz: ${argc_baz[@]}
echo val: ${argc_val[@]}
- "grep 'foo: 1' test.out"
- "grep 'bar: xyz' test.out"
- "grep 'baz: a b' test.out"
- "grep 'val: v1 v2' test.out"