ducaale/xh · info

Ignored

Error message

Ignored {flag}

What it means

Certain xh/TLS-related flags have no equivalent curl invocation that to_curl can honor (e.g. TLS backend selection like --native-tls, since curl picks its backend at build time). When such a flag is set and --curl/--curl-long translation runs, translate() emits 'Ignored <flag>' to tell you the generated curl command will not reflect that option.

Solutions

  1. Remove the ignored flag from the invocation since it will not affect the curl run
  2. Run the request through xh's own HTTP client (omit --curl/--curl-long) so the flag takes effect
  3. Configure curl's TLS backend globally (e.g. via its build or CURL_SSL env) instead of per-invocation xh flags
  4. Treat the warning as informational if the flag is irrelevant to your use case

Example fix

# before
xh --curl --native-tls https://example.org

# after (either drop the flag, or drop --curl)
xh --native-tls https://example.org
# or
xh --curl https://example.org
Defensive patterns

Strategy: fallback

Validate before calling

# Detect xh-only flags in curl-translated invocations
if echo "$xh_args" | grep -q -- '--native-tls'; then
  echo "warning: --native-tls has no curl equivalent; it will be ignored by --curl"
fi

Prevention

When it happens

Trigger: Running xh with --curl/--curl-long while one of the ignored flags (e.g. --native-tls or similar TLS/behavior toggles in the `ignored` table) is enabled; the flag is valid for xh's native client but meaningless for the emitted curl command.

Common situations: Scripts that always pass --curl for debugging while also enabling TLS-backend flags; CI environments where xh runs with rustls/native-tls toggles but the actual request is delegated to curl; copying an xh alias that includes --native-tls.

Understand the failure class

Background: Conflicting config options: "cannot be used together" — configuration validation errors across open-source libraries — this error's family across 162 libraries.

Related errors


AI-assisted analysis of ducaale/xh@2404aceecc (2026-09-13). Data as JSON: /api/errors/998fe9a71eff5258. Report an issue: GitHub.

Appendix: source

Thrown at src/to_curl.rs:126

        (args.compress > 0, "-x/--compress"),
        // No equivalent
        (args.response_charset.is_some(), "--response-charset"),
        // No equivalent
        (args.response_mime.is_some(), "--response-mime"),
        // Already the default
        (args.all, "--all"),
        // No (straightforward?) equivalent
        (args.history_print.is_some(), "-P/--history-print"),
        // Might be possible to emulate with --cookie-jar but tricky
        (args.session.is_some(), "--session"),
        // Already the default (usually, depends on compile time options)
        // Unclear if you can even change this at runtime
        (args.native_tls, "--native-tls"),
    ];

    for (present, flag) in ignored {
        if present {
            cmd.warn(format!("Ignored {flag}"));
        }
    }

    if args.follow && !matches!(args.method, Some(Method::GET) | None) {
        cmd.warn("Using a combination of -X/--request and -L/--location which may cause unintended side effects.");
    }

    // Silently ignored:
    // - .ignore_stdin: assumed by default
    //   (to send stdin, --data-binary @- -H 'Content-Type: application/octet-stream')
    // - .curl and .curl_long: you are here

    // Output options
    if args.verbose > 0 {
        // Far from an exact match, but it does print the request headers
        cmd.opt("-v", "--verbose");
    }
    if args.quiet > 0 {

View on GitHub (pinned to 2404aceecc)