From 506a8e4a4efcd9b643f65d4aa958b433970deb15 Mon Sep 17 00:00:00 2001 From: kjuulh Date: Sun, 2 Jul 2023 01:00:04 +0200 Subject: [PATCH] feat: with arg descriptions Signed-off-by: kjuulh --- cuddle_cli/src/cli/subcommands/x.rs | 4 ++++ cuddle_cli/src/model.rs | 1 + 2 files changed, 5 insertions(+) diff --git a/cuddle_cli/src/cli/subcommands/x.rs b/cuddle_cli/src/cli/subcommands/x.rs index 8824edf..80d7013 100644 --- a/cuddle_cli/src/cli/subcommands/x.rs +++ b/cuddle_cli/src/cli/subcommands/x.rs @@ -49,6 +49,10 @@ pub fn build_scripts(cli: CuddleCli) -> Vec { arg_val = arg_val.default_value(def); } + if let Some(desc) = &arg_flag.description { + arg_val = arg_val.help(&*desc.clone().leak()) + } + cmd.arg(arg_val) } }; diff --git a/cuddle_cli/src/model.rs b/cuddle_cli/src/model.rs index 7eb8a1f..475c32f 100644 --- a/cuddle_cli/src/model.rs +++ b/cuddle_cli/src/model.rs @@ -12,6 +12,7 @@ pub enum CuddleBase { #[derive(Debug, Clone, PartialEq, Deserialize)] pub struct CuddleShellScriptArgEnv { pub key: String, + pub description: Option, } #[derive(Debug, Clone, PartialEq, Deserialize)]