# options.option_schema

- **Module:** options
- **Package:** libtmux
- **Language:** Rust
- **Kind:** function
- **Source:** https://github.com/libtmux/libtmux-rs/blob/f0e37052c232636b61d095817046e6bfc8f2ca40/crates/libtmux/src/options.rs#L343
- **Page:** https://libtmux.org/en/rs/latest/reference/options-option_schema/

```
options.option_schema(name: &str) -> Option<&'static OptionSchema>
```

Look up what tmux declares about one option.

An option tmux does not declare, such as a user option beginning with `@`,
returns `None`: it has no type beyond the text stored in it.

The name may carry an array index, as `after-new-window[0]` does, which is
ignored for the lookup because every element of an array option shares one
type.

## Example

```rust
use libtmux::{OptionKind, option_schema};

// `status` looks like a flag but accepts on, off, and 2 through 5, so
// tmux declares it a choice. The schema records that rather than guessing.
assert_eq!(option_schema("status").map(|o| o.kind()), Some(OptionKind::Choice));
assert_eq!(option_schema("mouse").map(|o| o.kind()), Some(OptionKind::Flag));
assert_eq!(option_schema("history-limit").map(|o| o.kind()), Some(OptionKind::Number));
assert_eq!(option_schema("after-new-window[0]").map(|o| o.kind()), Some(OptionKind::Command));
assert_eq!(option_schema("@mine"), None);
```
