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>
This commit is contained in:
@@ -66,19 +66,22 @@ func (c *commandVolumeTierMove) Do(args []string, commandEnv *CommandEnv, writer
|
||||
source := tierCommand.String("fromDiskType", "", "the source disk type")
|
||||
target := tierCommand.String("toDiskType", "", "the target disk type")
|
||||
parallelLimit := tierCommand.Int("parallelLimit", 0, "limit the number of parallel copying jobs")
|
||||
applyChange := tierCommand.Bool("force", false, "actually apply the changes")
|
||||
applyChange := tierCommand.Bool("apply", false, "actually apply the changes")
|
||||
// TODO: remove this alias
|
||||
applyChangeAlias := tierCommand.Bool("force", false, "actually apply the changes (alias for -apply)")
|
||||
ioBytePerSecond := tierCommand.Int64("ioBytePerSecond", 0, "limit the speed of move")
|
||||
replicationString := tierCommand.String("toReplication", "", "the new target replication setting")
|
||||
|
||||
if err = tierCommand.Parse(args); err != nil {
|
||||
return nil
|
||||
}
|
||||
infoAboutSimulationMode(writer, *applyChange, "-force")
|
||||
|
||||
handleDeprecatedForceFlag(writer, tierCommand, applyChangeAlias, applyChange)
|
||||
infoAboutSimulationMode(writer, *applyChange, "-apply")
|
||||
|
||||
if err = commandEnv.confirmIsLocked(args); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
fromDiskType := types.ToDiskType(*source)
|
||||
toDiskType := types.ToDiskType(*target)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user