oven-sh/bun · error · clap::Error
InvalidArgument
Error message
InvalidArgument
What it means
CLI argument-parse error: the provided argument is not recognized or malformed for the current command context — an unknown flag/positional or a value in the wrong shape. Rejected before the command runs.
Solutions
- Check spelling of the flag against `--help`
- Remove arguments not supported by this subcommand
- Quote values containing spaces or special characters
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at src/clap/error.rs:7 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of oven-sh/bun@8c5296ac45 (2026-08-16).
Data as JSON: /api/errors/6995bd2b60655307.
Report an issue: GitHub.
Appendix: source
Thrown at src/clap/error.rs:7
#[derive(Debug, Clone, Copy, PartialEq, Eq, thiserror::Error)]
pub enum Error {
#[error("DoesntTakeValue")]
DoesntTakeValue,
#[error("MissingValue")]
MissingValue,
#[error("InvalidArgument")]
InvalidArgument,
#[error("WriteFailed")]
WriteFailed,
}
impl Error {
#[allow(clippy::trivially_copy_pass_by_ref)]
pub fn name(&self) -> &'static str {
match self {
Self::DoesntTakeValue => "DoesntTakeValue",
Self::MissingValue => "MissingValue",
Self::InvalidArgument => "InvalidArgument",
Self::WriteFailed => "WriteFailed",
}
}
}
impl bun_core::output::ErrName for Error {View on GitHub (pinned to 8c5296ac45)