{"record":{"id":"556d00acf1c74d78","repo":"ramensoftware/windhawk","slug":"data-import-would-with-yes","errorCode":null,"errorMessage":"data import would (with --yes):","messagePattern":"data import would \\(with --yes\\):","errorType":"console","errorClass":null,"httpStatus":null,"severity":"info","filePath":"src/windhawk-core/cli/src/commands/data.rs","lineNumber":200,"sourceCode":"    match scope {\n        ModScope::Ids { ids } => ids.iter().cloned().collect(),\n        ModScope::Keyword(ModScopeKeyword::None) => BTreeSet::new(),\n        ModScope::Keyword(ModScopeKeyword::AllExceptLocal) => {\n            all().filter(|id| !is_local_id(id)).collect()\n        }\n        ModScope::Keyword(ModScopeKeyword::All) => all().collect(),\n    }\n}\n\n/// Print the planned import actions to stderr, so a run without `--yes` shows\n/// what it would do before refusing (exit 2).\nfn print_import_plan(\n    env: &Environment,\n    manifest: &UserDataManifest,\n    selection: &UserDataSelection,\n) {\n    let scope = import_scope_ids(manifest, &selection.mods);\n    env.logger.warn(\"data import would (with --yes):\");\n    if selection.app_settings && manifest.has_app_settings {\n        env.logger\n            .warn(\"  - apply the archived Windhawk app settings\");\n    }\n    env.logger\n        .warn(&format!(\"  - import {} mod(s):\", scope.len()));\n    for m in &manifest.mods {\n        if scope.contains(&m.mod_id) {\n            env.logger\n                .warn(&format!(\"      {} {}\", m.mod_id, m.version));\n        }\n    }\n}\n\n/// Render a core import-progress event on stderr (via the logger, so `--quiet`\n/// suppresses the informational lines but keeps failure warnings). A stamped\n/// `compileTarget` event names the mod being compiled; the per-mod\n/// `ImportProgress` markers report the start and terminal outcome of each mod.","sourceCodeStart":182,"sourceCodeEnd":218,"githubUrl":"https://github.com/ramensoftware/windhawk/blob/61d99ed8e182e1af1b60109612b6763ad1b4b74e/src/windhawk-core/cli/src/commands/data.rs#L182-L218","documentation":"This is a dry-run banner printed by `data import` when `--yes` is absent: 'data import would (with --yes):'. It is not an exception — the import deliberately stops after showing the plan so the user can confirm before anything is written.","triggerScenarios":"Running `windhawk data import <archive>` without the `--yes` flag; the CLI prints the plan header and then each planned action, then exits without importing.","commonSituations":"First-time imports where users inspect what will change; CI scripts that forgot `--yes` and stall or no-op.","solutions":["Add `--yes` to the command to actually perform the import","Review the printed plan to confirm the mods/settings that will be applied","For automation, pass `--yes` (after validating the archive) to avoid interactive gating"],"exampleFix":"// before\nwindhawk data import backup.whc\n// after\nwindhawk data import backup.whc --yes","handlingStrategy":"validation","validationCode":"if !args.yes { eprintln!(\"dry-run only; pass --yes to apply\"); }","typeGuard":null,"tryCatchPattern":"// no exception to catch: detect the dry-run banner in output\nif output.contains(\"data import would (with --yes):\") {\n    eprintln!(\"import did not run; re-run with --yes\");\n}","preventionTips":["Always pass --yes in scripts/non-interactive contexts","Review dry-run output once before automating with --yes"],"tags":["cli","import","dry-run"],"backgroundTag":"missing-required-flag","analyzedSha":"61d99ed8e182e1af1b60109612b6763ad1b4b74e","analyzedAt":"2026-09-12T14:02:41.115Z","contentChangedAt":"2026-09-12T14:02:41.115Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}