1
1
mirror of https://github.com/wader/fq.git synced 2024-12-28 08:02:28 +03:00
fq/pkg/interp/args_test.jq
Mattias Wadman 970465996c Init
2021-09-12 13:08:42 +02:00

22 lines
379 B
Plaintext

include "assert";
include "args";
[ { name: "Basic parse",
args: ["-a", "123", "b"],
opts: {
"a": {
short: "-a",
long: "--abc",
description: "Set abc",
string: true
}
},
expected: {
"parsed": {
"a": "123"
},
"rest": ["b"]
}
}
][] | assert(.name; args_parse(.args; .opts); .expected)