{"record":{"id":"6b06ff016829b847","repo":"nikivdev/code","slug":"usage-f-migrate-target-or-f-migrate-source-t","errorCode":null,"errorMessage":"Usage: f migrate <target> OR f migrate <source> <target> OR f migrate code <relative>","messagePattern":"Usage: f migrate <target> OR f migrate <source> <target> OR f migrate code <relative>","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/code.rs","lineNumber":249,"sourceCode":"                tgt_path\n            } else {\n                std::env::current_dir()?.join(&tgt_path)\n            };\n            (src_path, tgt_path)\n        }\n        // Only one path: f migrate <target> (source is cwd)\n        (Some(tgt), None) => {\n            let tgt_path = config::expand_path(&tgt);\n            let tgt_path = if tgt_path.is_absolute() {\n                tgt_path\n            } else {\n                std::env::current_dir()?.join(&tgt_path)\n            };\n            (from, tgt_path)\n        }\n        // No paths provided\n        (None, _) => {\n            bail!(\n                \"Usage: f migrate <target> OR f migrate <source> <target> OR f migrate code <relative>\"\n            );\n        }\n    };\n\n    migrate_to_path(\n        &from,\n        &target,\n        cmd.copy,\n        cmd.dry_run,\n        cmd.skip_claude,\n        cmd.skip_codex,\n    )\n}\n\n/// Migrate a folder to an arbitrary target path (not necessarily ~/code).\nfn migrate_to_path(\n    from: &Path,","sourceCodeStart":231,"sourceCodeEnd":267,"githubUrl":"https://github.com/nikivdev/code/blob/a747e741ae92c09071d0ae946ab48488adcff1ce/src/code.rs#L231-L267","documentation":"A usage error thrown by run_migrate (src/code.rs:249) when `f migrate` is invoked with no positional arguments. The command supports three forms — migrate <target>, migrate <source> <target>, or migrate code <relative> — and none were supplied, so there is nothing to act on.","triggerScenarios":"Running `f migrate` bare, or where argument parsing produced both source and target as None (e.g. piping empty args through a wrapper script).","commonSituations":"Forgetting arguments in shell scripts; aliasing `f migrate` expecting an interactive picker that doesn't exist; typos that swallowed arguments (e.g. unquoted empty variable).","solutions":["Provide a target: `f migrate <target>` to migrate the current directory.","Provide both endpoints: `f migrate <source> <target>`.","For code-root moves use: `f migrate code <relative>`.","Run `f migrate --help` (or `f --help`) to see exact argument forms."],"exampleFix":"// before\n$ f migrate\nError: Usage: f migrate <target> OR ... OR f migrate code <relative>\n// after\n$ f migrate ~/code/new-home   # or: f migrate code myproject","handlingStrategy":"validation","validationCode":"// Shell: require at least one argument before invoking migrate\n[ \"$#\" -ge 1 ] || { echo \"usage: f migrate <target> | <source> <target> | code <relative>\"; exit 1; }","typeGuard":null,"tryCatchPattern":"match run_migrate(opts) {\n    Err(e) if e.to_string().starts_with(\"Usage: f migrate\") => {\n        eprintln!(\"Missing arguments — see `f migrate --help`.\");\n    }\n    other => other?,\n}","preventionTips":["Quote shell variables so empty values don't silently drop arguments","Wrap f migrate invocations in scripts that validate arg counts","Check `f --help` for the three accepted migrate forms before scripting"],"tags":["usage","cli","argument-error","rust"],"backgroundTag":"missing-required-argument","analyzedSha":"a747e741ae92c09071d0ae946ab48488adcff1ce","analyzedAt":"2026-09-01T22:43:55.719Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}