From 15597dbe6942ec053541398ce0e9dedc10a4d3ea Mon Sep 17 00:00:00 2001 From: Jack Wills <32690432+mrjackwills@users.noreply.github.com> Date: Sat, 1 Oct 2022 17:43:20 +0000 Subject: [PATCH] chore: Update clap to v4 --- Cargo.toml | 4 ++-- src/parse_args/mod.rs | 20 ++++++++++---------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 12c456f..79d4580 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,7 +3,7 @@ name = "oxker" version = "0.1.4" edition = "2021" authors = ["Jack Wills "] -description = "a simple tui to view & control docker containers" +description = "A simple tui to view & control docker containers" repository = "https://github.com/mrjackwills/oxker" homepage = "https://github.com/mrjackwills/oxker" license = "MIT" @@ -15,7 +15,7 @@ categories = ["command-line-utilities"] anyhow = "1.0" bollard = "0.13" cansi = "2.2" -clap={version="3.2", features = ["derive", "unicode"] } +clap={version="4.0", features = ["derive", "unicode", "color"] } crossterm = "0.25" futures-util = "0.3" parking_lot = {version= "0.12"} diff --git a/src/parse_args/mod.rs b/src/parse_args/mod.rs index a115aed..b7ece6b 100644 --- a/src/parse_args/mod.rs +++ b/src/parse_args/mod.rs @@ -3,29 +3,29 @@ use std::process; use clap::Parser; use tracing::error; -#[derive(Parser, Debug, Clone)] -#[clap(about, version, author)] - +#[derive(Parser, Debug, Clone, Copy)] +// #[command(help_template = FULL_TEMPLATE)] +#[command(version, about)] pub struct CliArgs { /// Docker update interval in ms, minimum 1, reccomended 500+ #[clap(short = 'd', value_name = "ms", default_value_t = 1000)] pub docker_interval: u32, - /// Don't draw gui - for debugging - mostly pointless - #[clap(short = 'g')] - pub gui: bool, - /// Remove timestamps from Docker logs #[clap(short = 't')] pub timestamp: bool, + /// Attempt to colorize the logs + #[clap(short = 'c', conflicts_with = "raw")] + pub color: bool, + /// Show raw logs, default is to remove ansi formatting #[clap(short = 'r', conflicts_with = "color")] pub raw: bool, - /// Attempt to colorize the logs - #[clap(short = 'c', conflicts_with = "raw")] - pub color: bool, + /// Don't draw gui - for debugging - mostly pointless + #[clap(short = 'g')] + pub gui: bool, } impl CliArgs {