1
1
mirror of https://github.com/wader/fq.git synced 2024-12-18 10:52:44 +03:00
fq/pkg/interp/args_test.jq

22 lines
377 B
Plaintext
Raw Normal View History

2020-06-08 03:29:51 +03:00
include "assert";
include "args";
[ { name: "Basic parse",
args: ["-a", "123", "b"],
opts: {
"a": {
short: "-a",
long: "--abc",
description: "Set abc",
string: true
}
},
2021-09-07 02:38:52 +03:00
expected: {
2020-06-08 03:29:51 +03:00
"parsed": {
"a": "123"
},
"rest": ["b"]
}
}
2021-09-07 02:38:52 +03:00
][] | assert(.name; _args_parse(.args; .opts); .expected)