mirror of
https://github.com/TECHNOFAB11/tmux-copyrat.git
synced 2025-12-16 18:03:51 +01:00
chore(deps): bump clap to 3.0.0-beta.5
This commit is contained in:
parent
276d17ce8f
commit
077d16311e
9 changed files with 177 additions and 186 deletions
|
|
@ -1,26 +1,9 @@
|
|||
use clap::Clap;
|
||||
use std::str::FromStr;
|
||||
|
||||
use crate::error::ParseError;
|
||||
use clap::{ArgEnum, Parser};
|
||||
|
||||
/// Describes if, during rendering, a hint should aligned to the leading edge of
|
||||
/// the matched text, or to its trailing edge.
|
||||
#[derive(Debug, Clap)]
|
||||
#[derive(Debug, Clone, ArgEnum, Parser)]
|
||||
pub enum HintAlignment {
|
||||
Leading,
|
||||
Trailing,
|
||||
}
|
||||
|
||||
impl FromStr for HintAlignment {
|
||||
type Err = ParseError;
|
||||
|
||||
fn from_str(s: &str) -> Result<HintAlignment, ParseError> {
|
||||
match s {
|
||||
"leading" => Ok(HintAlignment::Leading),
|
||||
"trailing" => Ok(HintAlignment::Trailing),
|
||||
_ => Err(ParseError::ExpectedString(String::from(
|
||||
"leading or trailing",
|
||||
))),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue