flxzt/rnote · error
Expected only a single rnote file. The option…
Error message
Expected only a single rnote file. The option "--output-format" must be used when exporting multiple files.
What it means
When an explicit --output-file is provided, the export writes one input document to that single file. Exporting multiple rnote files therefore requires --output-format (which produces one output per input) instead; this error stops the ambiguous multi-input + single-output combination.
Solutions
- Replace --output-file with --output-format (e.g. --output-format pdf) when passing multiple input files.
- Pass only one .rnote file if you want to keep --output-file.
- Adjust scripts to switch flag sets based on the number of input files.
Example fix
// before rnote export doc a.rnote b.rnote --output-file out.pdf // after rnote export doc a.rnote b.rnote --output-format pdf
Defensive patterns
Strategy: validation
Validate before calling
if [ "$#" -gt 1 ] && [[ "$ARGS" == *"--output-file"* ]]; then echo "use --output-format for multiple inputs"; exit 2; fi
Prevention
- Rule of thumb: --output-file for one file, --output-format for many.
- Strip --output-file from flag templates when input count > 1.
- Test scripts with both single and multiple inputs.
When it happens
Trigger: `rnote export doc file1.rnote file2.rnote --output-file out.pdf` — output_file.is_some() and rnote_files.len() > 1.
Common situations: Batch exporting while keeping an --output-file flag from a previous single-file invocation; scripts parameterized with a fixed output file but variable input lists.
Related errors
- The option "--file-stem" cannot be used when exporting…
- "--output-file" and "--output-format" are mutually…
- Failed to get filename from the supplied file
- There must be at least one rnote file specified for…
- The output file " " needs to have a supported extension to…
AI-assisted analysis of flxzt/rnote@bbc5354502 (2026-09-08).
Data as JSON: /api/errors/fe782588f950f197.
Report an issue: GitHub.
Appendix: source
Thrown at crates/rnote-cli/src/export.rs:77
)?;
match output_file {
Some(output_file) => {
let Some(rnote_file) = rnote_files.first() else {
return Err(anyhow::anyhow!(
"There must be at least one rnote file specified for exporting."
));
};
validators::file_has_ext(rnote_file, "rnote")?;
let output_file = get_output_file_path(
output_file,
on_conflict,
&mut on_conflict_overwrite,
&export_command,
)?;
if rnote_files.len() > 1 {
return Err(anyhow::anyhow!(
"Expected only a single rnote file. The option \"--output-format\" must be used when exporting multiple files."
));
}
let rnote_file_disp = rnote_file.display().to_string();
let output_file_disp = output_file.display().to_string();
let progressbar = cli::new_progressbar(format!(
"Exporting \"{rnote_file_disp}\" to: \"{output_file_disp}\"."
));
if let Err(e) = export_to_file(
&mut engine,
rnote_file,
output_file,
&export_command,
on_conflict,
&mut on_conflict_overwrite,
open,View on GitHub (pinned to bbc5354502)