Follow-up from review comment on #1076 (line R172): allow the -H/--header flag on apify api to be passed multiple times, so users can do:
apify api GET /v2/users/me -H XX:YY -H ZZ:AA
Current behavior
src/commands/api.ts:172-179 declares header as a single Flags.string. The flag can only be used once, so to send multiple headers users have to pass a JSON object:
apify api GET /v2/users/me -H '{"X-Foo": "bar", "X-Baz": "qux"}'
Desired behavior
Accept repeated -H key:value occurrences, matching the familiar curl ergonomics. The JSON-object form can stay as a convenience, but repeated flags should be the primary path.
Notes
- Requires array/multiple-value support in the command framework's
Flags.string (or a new Flags.stringArray-equivalent). Worth checking whether the framework already supports this before extending it.
- Update the flag description once the behavior changes.
Follow-up from review comment on #1076 (line R172): allow the
-H/--headerflag onapify apito be passed multiple times, so users can do:Current behavior
src/commands/api.ts:172-179declaresheaderas a singleFlags.string. The flag can only be used once, so to send multiple headers users have to pass a JSON object:apify api GET /v2/users/me -H '{"X-Foo": "bar", "X-Baz": "qux"}'Desired behavior
Accept repeated
-H key:valueoccurrences, matching the familiarcurlergonomics. The JSON-object form can stay as a convenience, but repeated flags should be the primary path.Notes
Flags.string(or a newFlags.stringArray-equivalent). Worth checking whether the framework already supports this before extending it.