From c13275142639af54edf5b9a0363b7bfcb6b48711 Mon Sep 17 00:00:00 2001 From: 魏曹先生 <1992414357@qq.com> Date: Wed, 7 Jan 2026 19:11:42 +0800 Subject: Remove --force flag from jv init command The --force flag is no longer needed as the command now always checks if the directory is empty. The corresponding help text in locale files has also been removed. --- src/bin/jv.rs | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'src/bin') diff --git a/src/bin/jv.rs b/src/bin/jv.rs index 1bed0d9..de8de61 100644 --- a/src/bin/jv.rs +++ b/src/bin/jv.rs @@ -468,10 +468,6 @@ struct InitWorkspaceArgs { /// Show help information #[arg(short, long)] help: bool, - - /// Force create, ignore files in the directory - #[arg(short, long)] - force: bool, } #[derive(Parser, Debug)] @@ -1410,7 +1406,7 @@ async fn jv_create(args: CreateWorkspaceArgs) { } } -async fn jv_init(args: InitWorkspaceArgs) { +async fn jv_init(_args: InitWorkspaceArgs) { let path = match current_dir() { Ok(path) => path, Err(e) => { @@ -1419,7 +1415,7 @@ async fn jv_init(args: InitWorkspaceArgs) { } }; - if !args.force && path.exists() && !is_directory_empty(&path).await { + if path.exists() && !is_directory_empty(&path).await { eprintln!("{}", t!("jv.fail.init_create_dir_not_empty").trim()); return; } -- cgit