{"record":{"id":"3ae9292c0be68699","repo":"flxzt/rnote","slug":"the-option-file-stem-cannot-be-used-when-expor","errorCode":null,"errorMessage":"The option \"--file-stem\" cannot be used when exporting multiple rnote files.","messagePattern":"The option \"--file-stem\" cannot be used when exporting multiple rnote files\\.","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/rnote-cli/src/export.rs","lineNumber":44,"sourceCode":") -> anyhow::Result<()> {\n    if rnote_files.is_empty() {\n        return Err(anyhow::anyhow!(\n            \"There must be at least one rnote file specified for exporting.\"\n        ));\n    }\n\n    let config = EngineConfigShared::default();\n    let mut engine = Engine::default();\n    let _ = engine.install_config(&config, None);\n    let mut on_conflict_overwrite = None;\n    let output_file = match &export_command {\n        cli::ExportCommand::Doc { file_args, .. } => file_args.output_file.as_ref(),\n        cli::ExportCommand::Selection { file_args, .. } => file_args.output_file.as_ref(),\n        cli::ExportCommand::DocPages {\n            output_file_stem, ..\n        } => {\n            if rnote_files.len() > 1 && output_file_stem.is_some() {\n                return Err(anyhow::anyhow!(\n                    \"The option \\\"--file-stem\\\" cannot be used when exporting multiple rnote files.\"\n                ));\n            }\n            None\n        }\n    };\n\n    apply_export_prefs(\n        &config,\n        &export_command,\n        output_file,\n        no_background,\n        no_pattern,\n        optimize_printing,\n    )?;\n\n    match output_file {\n        Some(output_file) => {","sourceCodeStart":26,"sourceCodeEnd":62,"githubUrl":"https://github.com/flxzt/rnote/blob/bbc5354502ba2fc83eec2670b535348825e679a6/crates/rnote-cli/src/export.rs#L26-L62","documentation":"For the `docpages` export subcommand, --file-stem supplies the base name for each generated page file. When exporting multiple rnote files at once, a single stem would make pages from different documents collide or be ambiguous, so the CLI rejects combining --file-stem with more than one input file.","triggerScenarios":"Running `rnote export docpages file1.rnote file2.rnote --file-stem page` — i.e. DocPages with rnote_files.len() > 1 and Some(output_file_stem).","commonSituations":"Batch-exporting several documents while reusing a single-file command line out of habit; scripts that append --file-stem unconditionally regardless of input count.","solutions":["Drop --file-stem when exporting multiple files and let each document derive its own stem.","Export one file at a time (one invocation per rnote file) if you need a custom --file-stem.","Update scripts to conditionally add --file-stem only when a single input file is given."],"exampleFix":"// before\nrnote export docpages a.rnote b.rnote --file-stem page\n// after\nrnote export docpages a.rnote b.rnote\n// or per-file:\nrnote export docpages a.rnote --file-stem page","handlingStrategy":"validation","validationCode":"if [ \"$#\" -gt 1 ] && [[ \"$ARGS\" == *\"--file-stem\"* ]]; then echo \"--file-stem only valid with a single input\"; exit 2; fi","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use --file-stem only for single-file docpages exports.","Build CLI arguments conditionally based on the input file count.","Prefer default stems for batch exports."],"tags":["cli","conflicting-options"],"backgroundTag":"mutually-exclusive-options","analyzedSha":"bbc5354502ba2fc83eec2670b535348825e679a6","analyzedAt":"2026-09-08T13:20:33.747Z","contentChangedAt":"2026-09-08T13:20:33.747Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}