{"record":{"id":"998fe9a71eff5258","repo":"ducaale/xh","slug":"ignored-flag","errorCode":null,"errorMessage":"Ignored {flag}","messagePattern":"Ignored (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"info","filePath":"src/to_curl.rs","lineNumber":126,"sourceCode":"        (args.compress > 0, \"-x/--compress\"),\n        // No equivalent\n        (args.response_charset.is_some(), \"--response-charset\"),\n        // No equivalent\n        (args.response_mime.is_some(), \"--response-mime\"),\n        // Already the default\n        (args.all, \"--all\"),\n        // No (straightforward?) equivalent\n        (args.history_print.is_some(), \"-P/--history-print\"),\n        // Might be possible to emulate with --cookie-jar but tricky\n        (args.session.is_some(), \"--session\"),\n        // Already the default (usually, depends on compile time options)\n        // Unclear if you can even change this at runtime\n        (args.native_tls, \"--native-tls\"),\n    ];\n\n    for (present, flag) in ignored {\n        if present {\n            cmd.warn(format!(\"Ignored {flag}\"));\n        }\n    }\n\n    if args.follow && !matches!(args.method, Some(Method::GET) | None) {\n        cmd.warn(\"Using a combination of -X/--request and -L/--location which may cause unintended side effects.\");\n    }\n\n    // Silently ignored:\n    // - .ignore_stdin: assumed by default\n    //   (to send stdin, --data-binary @- -H 'Content-Type: application/octet-stream')\n    // - .curl and .curl_long: you are here\n\n    // Output options\n    if args.verbose > 0 {\n        // Far from an exact match, but it does print the request headers\n        cmd.opt(\"-v\", \"--verbose\");\n    }\n    if args.quiet > 0 {","sourceCodeStart":108,"sourceCodeEnd":144,"githubUrl":"https://github.com/ducaale/xh/blob/2404aceecc08b0b2d100fedc96f57745cd5904dc/src/to_curl.rs#L108-L144","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Remove the ignored flag from the invocation since it will not affect the curl run","Run the request through xh's own HTTP client (omit --curl/--curl-long) so the flag takes effect","Configure curl's TLS backend globally (e.g. via its build or CURL_SSL env) instead of per-invocation xh flags","Treat the warning as informational if the flag is irrelevant to your use case"],"exampleFix":"# before\nxh --curl --native-tls https://example.org\n\n# after (either drop the flag, or drop --curl)\nxh --native-tls https://example.org\n# or\nxh --curl https://example.org","handlingStrategy":"fallback","validationCode":"# Detect xh-only flags in curl-translated invocations\nif echo \"$xh_args\" | grep -q -- '--native-tls'; then\n  echo \"warning: --native-tls has no curl equivalent; it will be ignored by --curl\"\nfi","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Do not mix TLS-backend flags with --curl/--curl-long translation","If curl runs the request, configure TLS at the curl level instead","Review 'Ignored' warnings in scripts; treat them as signals the flag was dropped","Keep xh aliases for native-client runs separate from --curl debug runs"],"tags":["cli","curl","tls","ignored-flag","warning"],"backgroundTag":"conflicting-config-options","analyzedSha":"2404aceecc08b0b2d100fedc96f57745cd5904dc","analyzedAt":"2026-09-13T19:13:33.814Z","contentChangedAt":"2026-09-13T19:13:33.814Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}