{"record":{"id":"a825123d47ffbf0e","repo":"flxzt/rnote","slug":"there-must-be-at-least-one-rnote-file-specified-fo","errorCode":null,"errorMessage":"There must be at least one rnote file specified for exporting.","messagePattern":"There must be at least one rnote file specified for exporting\\.","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/rnote-cli/src/export.rs","lineNumber":28,"sourceCode":"    SelectionExportFormat, SelectionExportPrefs,\n};\nuse rnote_engine::engine::{EngineConfigShared, EngineSnapshot};\nuse rnote_engine::{Engine, SelectionCollision};\nuse std::io::{self, IsTerminal};\nuse std::path::{Path, PathBuf};\n\n#[allow(clippy::too_many_arguments)]\npub(crate) async fn run_export(\n    rnote_files: Vec<PathBuf>,\n    no_background: bool,\n    no_pattern: bool,\n    optimize_printing: bool,\n    on_conflict: OnConflict,\n    open: bool,\n    export_command: cli::ExportCommand,\n) -> 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                ));","sourceCodeStart":10,"sourceCodeEnd":46,"githubUrl":"https://github.com/flxzt/rnote/blob/bbc5354502ba2fc83eec2670b535348825e679a6/crates/rnote-cli/src/export.rs#L10-L46","documentation":"Sentinel validation guard at the top of run_export: the CLI export command was invoked with an empty rnote_files list, so there is nothing to export. Fires when `rnote-cli export` is run without supplying any .rnote file path arguments.","triggerScenarios":"Invoking any `rnote export` subcommand (doc, docpages, selection) without supplying positional rnote file arguments.","commonSituations":"Running the export command with only option flags (e.g. only --output-format) and forgetting the input files; shell glob that matched nothing (e.g. `rnote export *.rnote` in a directory with no rnote files); a script variable holding the file list is empty.","solutions":["Pass at least one .rnote file as a positional argument, e.g. `rnote export doc notes.rnote --output-format pdf`.","Check that your glob/variable actually expands to files (run `ls *.rnote` first).","In scripts, validate the file list is non-empty before invoking rnote export."],"exampleFix":"// before\nrnote export doc --output-format pdf\n// after\nrnote export doc notes.rnote --output-format pdf","handlingStrategy":"validation","validationCode":"if [ -z \"$FILES\" ]; then echo \"usage: rnote export <subcmd> <file.rnote>...\"; exit 2; fi","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always list at least one .rnote file after the export subcommand.","Check globs matched files before expanding (nullglob behavior differs per shell).","Assert non-empty file-list variables in scripts."],"tags":["cli","missing-argument"],"backgroundTag":"missing-required-argument","analyzedSha":"bbc5354502ba2fc83eec2670b535348825e679a6","analyzedAt":"2026-09-08T13:20:33.747Z","contentChangedAt":"2026-09-08T13:20:33.747Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}