# error.OptionErrorKind

- **Module:** error
- **Package:** libtmux
- **Language:** Rust
- **Kind:** enum
- **Source:** https://github.com/libtmux/libtmux-rs/blob/f0e37052c232636b61d095817046e6bfc8f2ca40/crates/libtmux/src/error.rs#L225
- **Page:** https://libtmux.org/en/rs/latest/reference/error-optionerrorkind/

Which way tmux would not accept an option.

## Example

Each kind points at a different fix, so a caller can act instead of re-reading tmux's wording:

```rust
use libtmux::{Error, OptionErrorKind};

fn advise(error: &Error) -> &'static str {
    match error {
        Error::OptionRejected { kind, .. } => match kind {
            OptionErrorKind::Unknown => "check the spelling",
            OptionErrorKind::Ambiguous => "write more of the name",
            OptionErrorKind::BadValue => "the option will not hold that",
            _ => "tmux refused it",
        },
        _ => "not an option problem",
    }
}

let refused = Error::OptionRejected {
    kind: OptionErrorKind::Ambiguous,
    detail: "status-l".to_owned(),
};
assert_eq!(advise(&refused), "write more of the name");
```

## Members

- `Unknown` (constant): No option goes by that name.
- `Ambiguous` (constant): The name is a prefix of more than one option, so tmux will not guess.
- `BadValue` (constant): The option exists and will not hold that value.
