diff options
| author | Lisandro Pin <lisandro.pin@proton.ch> | 2025-11-10 04:58:38 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-11-09 19:58:38 -0800 |
| commit | 76e4a519646a60c612956d197652359b1d4ba477 (patch) | |
| tree | 37de583f5f6e79936bc137afe6e6d4b12e6065a5 /weed/shell/command_volume_delete_empty.go | |
| parent | 2a05af2e14741540cad00a410f8e851f863628c7 (diff) | |
| download | seaweedfs-76e4a519646a60c612956d197652359b1d4ba477.tar.xz seaweedfs-76e4a519646a60c612956d197652359b1d4ba477.zip | |
Unify the parameter to disable dry-run on weed shell commands to `-apply` (instead of `-force`). (#7450)
* Unify the parameter to disable dry-run on weed shell commands to --apply (instead of --force).
* lint
* refactor
* Execution Order Corrected
* handle deprecated force flag
* fix help messages
* Refactoring]: Using flag.FlagSet.Visit()
* consistent with other commands
* Checks for both flags
* fix toml files
---------
Co-authored-by: chrislu <chris.lu@gmail.com>
Diffstat (limited to 'weed/shell/command_volume_delete_empty.go')
| -rw-r--r-- | weed/shell/command_volume_delete_empty.go | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/weed/shell/command_volume_delete_empty.go b/weed/shell/command_volume_delete_empty.go index a81ebe6dd..9cf5f99ac 100644 --- a/weed/shell/command_volume_delete_empty.go +++ b/weed/shell/command_volume_delete_empty.go @@ -26,7 +26,7 @@ func (c *commandVolumeDeleteEmpty) Name() string { func (c *commandVolumeDeleteEmpty) Help() string { return `delete empty volumes from all volume servers - volume.deleteEmpty -quietFor=24h -force + volume.deleteEmpty -quietFor=24h -apply This command deletes all empty volumes from one volume server. @@ -41,11 +41,15 @@ func (c *commandVolumeDeleteEmpty) Do(args []string, commandEnv *CommandEnv, wri volDeleteCommand := flag.NewFlagSet(c.Name(), flag.ContinueOnError) quietPeriod := volDeleteCommand.Duration("quietFor", 24*time.Hour, "select empty volumes with no recent writes, avoid newly created ones") - applyBalancing := volDeleteCommand.Bool("force", false, "apply to delete empty volumes") + applyBalancing := volDeleteCommand.Bool("apply", false, "apply to delete empty volumes") + // TODO: remove this alias + applyBalancingAlias := volDeleteCommand.Bool("force", false, "apply to delete empty volumes (alias for -apply)") if err = volDeleteCommand.Parse(args); err != nil { return nil } - infoAboutSimulationMode(writer, *applyBalancing, "-force") + + handleDeprecatedForceFlag(writer, volDeleteCommand, applyBalancingAlias, applyBalancing) + infoAboutSimulationMode(writer, *applyBalancing, "-apply") if err = commandEnv.confirmIsLocked(args); err != nil { return |
