From 5e2c438dabc74d7e87fad46c725501753a0a8a26 Mon Sep 17 00:00:00 2001 From: Conrad Ludgate Date: Tue, 18 Oct 2022 09:50:22 +0100 Subject: Upgrade clap (#568) --- src/main.rs | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'src/main.rs') diff --git a/src/main.rs b/src/main.rs index 798f7a23..2f81f4fc 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,7 +1,7 @@ #![warn(clippy::pedantic, clippy::nursery)] #![allow(clippy::use_self, clippy::missing_const_for_fn)] // not 100% reliable -use clap::{AppSettings, Parser}; +use clap::Parser; use eyre::Result; use command::AtuinCmd; @@ -9,15 +9,25 @@ mod command; const VERSION: &str = env!("CARGO_PKG_VERSION"); +static HELP_TEMPLATE: &str = "\ +{before-help}{name} {version} +{author} +{about} + +{usage-heading} + {usage} + +{all-args}{after-help}"; + /// Magical shell history #[derive(Parser)] -#[clap( +#[command( author = "Ellie Huxtable ", version = VERSION, - global_setting(AppSettings::DeriveDisplayOrder), + help_template(HELP_TEMPLATE), )] struct Atuin { - #[clap(subcommand)] + #[command(subcommand)] atuin: AtuinCmd, } -- cgit v1.3.1