{"record":{"id":"e18cc8079e7fce50","repo":"bee-san/Ciphey","slug":"error-no-input-was-provided-please-use-ciphey","errorCode":null,"errorMessage":"Error. No input was provided. Please use ciphey --help","messagePattern":"Error\\. No input was provided\\. Please use ciphey --help","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/cli/mod.rs","lineNumber":92,"sourceCode":"    let min_log_level = match opts.verbose {\n        0 => \"Warn\",\n        1 => \"Info\",\n        2 => \"Debug\",\n        _ => \"Trace\",\n    };\n    env_logger::init_from_env(\n        env_logger::Env::default().filter_or(env_logger::DEFAULT_FILTER_ENV, min_log_level),\n    );\n\n    let input_text: String = match (opts.file.take(), opts.text.take()) {\n        (Some(_), Some(_)) => {\n            panic_failure_both_input_and_fail_provided();\n            unreachable!(\"panic helper should terminate the process\");\n        }\n        (Some(file), None) => read_and_parse_file(file),\n        (None, Some(text)) => text,\n        (None, None) => {\n            panic!(\"Error. No input was provided. Please use ciphey --help\")\n        }\n    };\n\n    trace!(\"Program was called with CLI 😉\");\n    trace!(\"Parsed the arguments\");\n    trace!(\"The inputted text is {}\", &input_text);\n\n    cli_args_into_config_struct(opts, input_text)\n}\n\n/// When the CLI is called with `-f` to open a file\n/// this function opens it\npub fn read_and_parse_file(file_path: String) -> String {\n    let mut file = File::open(&file_path).unwrap_or_else(|err| {\n        eprintln!(\"Error: Cannot open file '{}': {}\", file_path, err);\n        std::process::exit(1);\n    });\n","sourceCodeStart":74,"sourceCodeEnd":110,"githubUrl":"https://github.com/bee-san/Ciphey/blob/39864898d206e101036b2c7268dfaa4452eecd0e/src/cli/mod.rs#L74-L110","documentation":"Ciphey's CLI entry point parse_cli_args (src/cli/mod.rs:92) panics when clap parsing succeeds but neither -t/--text nor -f/--file was supplied. There is no default input mode and no stdin-reading fallback, so the match on (file, text) reaches the (None, None) arm and aborts the process with this message. It is a hard startup abort, not a recoverable library error.","triggerScenarios":"Invoking the binary with no input at all: `ciphey`, `ciphey -v`, `ciphey --wordlist list.txt` (flags that are not input sources). The pure trigger is a clap-parseable command line where both opts.file and opts.text are None.","commonSituations":"New users expecting an interactive prompt or stdin mode (neither exists); shell scripts where $CIPHERTEXT expands to empty or the -t flag was dropped during a refactor; CI jobs calling ciphey before wiring the input variable.","solutions":["Pass the ciphertext inline: `ciphey -t \"<ciphertext>\"`, or point at a file: `ciphey -f cipher.txt`","If you meant to pipe input, this CLI does not read stdin automatically — capture it first: `ciphey -t \"$(cat cipher.txt)\"` or write a temp file and use -f","Run `ciphey --help` to confirm the exact flags your build accepts"],"exampleFix":"# before\nciphey\n# after\nciphey -t \"SGVsbG8=\"","handlingStrategy":"validation","validationCode":"use clap::Parser;\nlet opts = Opts::parse();\nif opts.file.is_none() && opts.text.is_none() {\n    eprintln!(\"input required: pass -t <text> or -f <file>\");\n    std::process::exit(2);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Treat -t/-f as required inputs in wrapper scripts and fail early if the ciphertext variable is empty","Document that the CLI has no stdin mode; wire $(cat ...) or temp files in automation","Arg-test your invocation with `--help` before deploying to CI"],"tags":["rust","cli","clap","arguments"],"backgroundTag":"missing-required-argument","analyzedSha":"39864898d206e101036b2c7268dfaa4452eecd0e","analyzedAt":"2026-08-22T21:18:58.025Z","schemaVersion":2},"datasetVersion":"2026-08-23T01:17:44.959Z"}