From fe0fcadf3ac2b6b75241364991ad570b72bec243 Mon Sep 17 00:00:00 2001 From: HsiangNianian Date: Fri, 30 May 2025 00:01:43 +0800 Subject: feat: Update Cache command to accept a number instead of a command string --- src/main.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/main.rs') diff --git a/src/main.rs b/src/main.rs index fde5784..2d3dde4 100644 --- a/src/main.rs +++ b/src/main.rs @@ -44,8 +44,8 @@ enum Commands { ShowInternalCache, /// Cache a command to soon cache (for testing) Cache { - #[arg()] - cmd: String, + #[arg(value_name = "NUM", help = "Number to cache")] + num: usize, }, } @@ -538,7 +538,7 @@ fn main() { Some(Commands::Update) => soon_update(), Some(Commands::ShowCache) => soon_show_cache(&shell, cli.ngram, cli.debug), Some(Commands::ShowInternalCache) => soon_show_internal_cache(), - Some(Commands::Cache { cmd }) => soon_cache(&shell, cli.ngram, &cmd), + Some(Commands::Cache { num}) => soon_cache(&shell, num, ""), None => soon_now(&shell, cli.ngram, cli.debug), } } -- cgit v1.2.3-70-g09d2