Require manual confirmation to purge database with purge-db (#6154)

* Require manual confirmation to purge database

* Fix tests

* Rename to `purge-db-force and skip in non-interactive mode

* Do not skip when stdin_inputs is true

* Change prompt to be info logging to ensure consistent output

* Update warning text

* Move delete log after deletion
This commit is contained in:
Mac L
2024-08-20 06:03:40 +04:00
committed by GitHub
parent d957161740
commit 32f2e059c5
22 changed files with 116 additions and 104 deletions

View File

@@ -919,7 +919,15 @@ pub fn cli_app() -> Command {
.long("purge-db")
.action(ArgAction::SetTrue)
.help_heading(FLAG_HEADER)
.help("If present, the chain database will be deleted. Use with caution.")
.help("If present, the chain database will be deleted. Requires manual confirmation.")
.display_order(0)
)
.arg(
Arg::new("purge-db-force")
.long("purge-db-force")
.action(ArgAction::SetTrue)
.help_heading(FLAG_HEADER)
.help("If present, the chain database will be deleted without confirmation. Use with caution.")
.display_order(0)
)
.arg(