chore(deps): bump clap to 3.0.0-beta.5

This commit is contained in:
graelo 2021-10-24 09:33:55 +02:00
parent 276d17ce8f
commit 077d16311e
9 changed files with 177 additions and 186 deletions

View file

@ -1,5 +1,5 @@
use crate::error;
use clap::Clap;
use clap::Parser;
use termion::color;
pub fn parse_color(src: &str) -> Result<Box<dyn color::Color>, error::ParseError> {
@ -52,7 +52,7 @@ mod tests {
/// - `focus_*` colors are used to render the currently focused text span.
/// - `normal_*` colors are used to render other text spans.
/// - `hint_*` colors are used to render the hints.
#[derive(Clap, Debug)]
#[derive(Parser, Debug)]
#[clap(about)] // Needed to avoid this doc comment to be used as overall `about`.
pub struct UiColors {
/// Foreground color for base text.

View file

@ -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",
))),
}
}
}