options.option_schema
Rust
- Python Unavailable
- Ruby Unavailable
- Lua Unavailable
- TypeScript Unavailable
- Rust
- Go Unavailable
- Java Unavailable
- .NET Unavailable
- C++ Unavailable
- Swift Unavailable
- Module
- options
- Package
- libtmux
- Source
- crates/libtmux/src/options.rs
- 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
@, returnsNone: 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.Examples
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);
0 declared, 0 inherited