{"record":{"id":"e1d99849db2ac639","repo":"can1357/oh-my-pi","slug":"missing-operand","errorCode":null,"errorMessage":"missing operand","messagePattern":"missing operand","errorType":"error_code","errorClass":"SeqError","httpStatus":null,"severity":"error","filePath":"crates/pi-builtins/src/seq.rs","lineNumber":444,"sourceCode":"\n#[derive(Debug, Error)]\npub enum SeqError {\n\t/// An error parsing the input arguments.\n\t///\n\t/// The parameters are the [`String`] argument as read from the\n\t/// command line and the underlying parsing error itself.\n\t#[error(\"invalid {} argument: {}\", parse_error_type(.1), .0.quote())]\n\tParseError(String, ParseNumberError),\n\n\t/// The increment argument was zero, which is not allowed.\n\t///\n\t/// The parameter is the increment argument as a [`String`] as read\n\t/// from the command line.\n\t#[error(\"invalid Zero increment value: {}\", .0.quote())]\n\tZeroIncrement(String),\n\n\t/// No arguments were passed to this function, 1 or more is required\n\t#[error(\"missing operand\")]\n\tNoArguments,\n\n\t/// Both a format and equal width where passed to seq\n\t#[error(\"format string may not be specified when printing equal width strings\")]\n\tFormatAndEqualWidth,\n}\n\nfn parse_error_type(e: &ParseNumberError) -> &'static str {\n\tmatch e {\n\t\tParseNumberError::Float => \"floating point\",\n\t\tParseNumberError::Nan => \"'not-a-number'\",\n\t}\n}\n\n}\n\nuse self::{error::SeqError, number::PreciseNumber};\n","sourceCodeStart":426,"sourceCodeEnd":462,"githubUrl":"https://github.com/can1357/oh-my-pi/blob/969062200754ea02cfac922e5ebb8c608c079e15/crates/pi-builtins/src/seq.rs#L426-L462","documentation":"This error is the `NoArguments` variant of the seq error enum in the pi-builtins `seq` builtin. The `seq` command requires at least one numeric operand (the limit value); throwing with zero arguments would be ambiguous. It mirrors GNU seq's 'missing operand' diagnostic.","triggerScenarios":"Calling the seq builtin with an empty argument list — no start, increment, or limit operand supplied at all.","commonSituations":"A script builds the seq invocation from variables that are all empty/unset, or a user runs `seq` interactively without any arguments.","solutions":["Pass at least one argument: `seq <limit>` (e.g. `seq 10`).","For a full range, supply the desired form: `seq <last>`, `seq <first> <last>`, or `seq <first> <increment> <last>`.","In scripts, guard against empty variables before invoking seq (e.g. `${LIMIT:?LIMIT is unset}`)."],"exampleFix":"// before\nseq()\n\n// after\nseq(\"10\")","handlingStrategy":"validation","validationCode":"if (args.is_empty()) {\n    eprintln!(\"seq: missing operand\");\n    std::process::exit(1);\n}\nseq(&args);","typeGuard":null,"tryCatchPattern":"match seq_result {\n    Err(SeqError::NoArguments) => eprintln!(\"usage: seq <first> [increment] <last>\"),\n    Err(e) => eprintln!(\"seq: {e}\"),\n    Ok(out) => print!(\"{out}\"),\n}","preventionTips":["Always pass at least one operand to seq.","In shell, use ${VAR:?msg} to fail fast on empty variables feeding seq.","Wrap seq wrappers with an argument-count assertion in scripts."],"tags":["arguments","cli","builtin","seq"],"backgroundTag":"missing-cli-operand","analyzedSha":"969062200754ea02cfac922e5ebb8c608c079e15","analyzedAt":"2026-08-31T10:29:35.737Z","schemaVersion":2},"datasetVersion":"2026-08-31T14:17:45.589Z"}