chore: Update clap to v4

This commit is contained in:
Jack Wills
2022-10-01 17:43:20 +00:00
parent 17dc604bef
commit 15597dbe69
2 changed files with 12 additions and 12 deletions
+2 -2
View File
@@ -3,7 +3,7 @@ name = "oxker"
version = "0.1.4" version = "0.1.4"
edition = "2021" edition = "2021"
authors = ["Jack Wills <email@mrjackwills.com>"] authors = ["Jack Wills <email@mrjackwills.com>"]
description = "a simple tui to view & control docker containers" description = "A simple tui to view & control docker containers"
repository = "https://github.com/mrjackwills/oxker" repository = "https://github.com/mrjackwills/oxker"
homepage = "https://github.com/mrjackwills/oxker" homepage = "https://github.com/mrjackwills/oxker"
license = "MIT" license = "MIT"
@@ -15,7 +15,7 @@ categories = ["command-line-utilities"]
anyhow = "1.0" anyhow = "1.0"
bollard = "0.13" bollard = "0.13"
cansi = "2.2" cansi = "2.2"
clap={version="3.2", features = ["derive", "unicode"] } clap={version="4.0", features = ["derive", "unicode", "color"] }
crossterm = "0.25" crossterm = "0.25"
futures-util = "0.3" futures-util = "0.3"
parking_lot = {version= "0.12"} parking_lot = {version= "0.12"}
+10 -10
View File
@@ -3,29 +3,29 @@ use std::process;
use clap::Parser; use clap::Parser;
use tracing::error; use tracing::error;
#[derive(Parser, Debug, Clone)] #[derive(Parser, Debug, Clone, Copy)]
#[clap(about, version, author)] // #[command(help_template = FULL_TEMPLATE)]
#[command(version, about)]
pub struct CliArgs { pub struct CliArgs {
/// Docker update interval in ms, minimum 1, reccomended 500+ /// Docker update interval in ms, minimum 1, reccomended 500+
#[clap(short = 'd', value_name = "ms", default_value_t = 1000)] #[clap(short = 'd', value_name = "ms", default_value_t = 1000)]
pub docker_interval: u32, pub docker_interval: u32,
/// Don't draw gui - for debugging - mostly pointless
#[clap(short = 'g')]
pub gui: bool,
/// Remove timestamps from Docker logs /// Remove timestamps from Docker logs
#[clap(short = 't')] #[clap(short = 't')]
pub timestamp: bool, 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 /// Show raw logs, default is to remove ansi formatting
#[clap(short = 'r', conflicts_with = "color")] #[clap(short = 'r', conflicts_with = "color")]
pub raw: bool, pub raw: bool,
/// Attempt to colorize the logs /// Don't draw gui - for debugging - mostly pointless
#[clap(short = 'c', conflicts_with = "raw")] #[clap(short = 'g')]
pub color: bool, pub gui: bool,
} }
impl CliArgs { impl CliArgs {