Prerelease This site documents an alpha of libtmux. Its structure, URLs and APIs are subject to change.

error.OptionErrorKind

Rust
  • Python Unavailable
  • TypeScript Unavailable
  • Rust
  • Go Unavailable
  • Java Unavailable
  • .NET Unavailable
  • C++ Unavailable
  • Swift Unavailable

View as Markdown

Module
error
Package
libtmux
Source
crates/libtmux/src/error.rs
enum error.OptionErrorKind
enum [source]
enum [source]
enum error.OptionErrorKind

Which way tmux would not accept an option.

Examples

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

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");

3 declared, 0 inherited

Members

  • 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.
  • Unknown constant No option goes by that name.
Esc

Type to search.