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

  1. Replace --output-file with --output-format (e.g. --output-format pdf) when passing multiple input files.
  2. Pass only one .rnote file if you want to keep --output-file.
  3. 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

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


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)