You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
clap doesn't support this, but there's an issue for it (clap-rs/clap#815). It also has an escape hatch for looking at unknown arguments, but I don't know exactly how powerful it is, and I'm worried it would degrade the usual error message.
A downside of HTTPie's current approach (and probably of the escape hatch approach for clap) is that the order of the flags doesn't matter. Normally the last flag counts, so --form --json works like --json and --json --form like --form, but --no-check-status always overrides --check-status, even if it comes first. But that's acceptable, since the typical usage would be to add --no-check-status after an alias that includes --check-status, and the opposite wouldn't come up because there's little reason to use --no-check-status in an alias.
If this is added to clap it might take a long time before it's usable in xh. It'd land in version 3.0.0, and then after that we might have to wait for structopt to support it (or maybe switch to clap_derive).
The text was updated successfully, but these errors were encountered:
HTTPie lets you negate flags, e.g.
--no-check-status
cancels out--check-status
. Whileargparse
has optional support for that, HTTPie does it by manually processing argumentsargparse
didn't recognize (plus a few hardcoded cases).clap
doesn't support this, but there's an issue for it (clap-rs/clap#815). It also has an escape hatch for looking at unknown arguments, but I don't know exactly how powerful it is, and I'm worried it would degrade the usual error message.A downside of HTTPie's current approach (and probably of the escape hatch approach for
clap
) is that the order of the flags doesn't matter. Normally the last flag counts, so--form --json
works like--json
and--json --form
like--form
, but--no-check-status
always overrides--check-status
, even if it comes first. But that's acceptable, since the typical usage would be to add--no-check-status
after an alias that includes--check-status
, and the opposite wouldn't come up because there's little reason to use--no-check-status
in an alias.If this is added to
clap
it might take a long time before it's usable inxh
. It'd land in version 3.0.0, and then after that we might have to wait forstructopt
to support it (or maybe switch toclap_derive
).The text was updated successfully, but these errors were encountered: