mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-01-19 02:48:24 +00:00
Merge branch 'master' into support_ssd_volume
This commit is contained in:
commit
97dcae827b
|
@ -34,14 +34,22 @@ func (c *commandCollectionDelete) Do(args []string, commandEnv *CommandEnv, writ
|
||||||
}
|
}
|
||||||
|
|
||||||
colDeleteCommand := flag.NewFlagSet(c.Name(), flag.ContinueOnError)
|
colDeleteCommand := flag.NewFlagSet(c.Name(), flag.ContinueOnError)
|
||||||
collectionName := colDeleteCommand.String("collection", "", "collection to delete")
|
collectionName := colDeleteCommand.String("collection", "", "collection to delete. Use '_default_' for the empty-named collection.")
|
||||||
applyBalancing := colDeleteCommand.Bool("force", false, "apply the collection")
|
applyBalancing := colDeleteCommand.Bool("force", false, "apply the collection")
|
||||||
if err = colDeleteCommand.Parse(args); err != nil {
|
if err = colDeleteCommand.Parse(args); err != nil {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if *collectionName == "" {
|
||||||
|
return fmt.Errorf("empty collection name is not allowed")
|
||||||
|
}
|
||||||
|
|
||||||
|
if *collectionName == "_default_" {
|
||||||
|
*collectionName = ""
|
||||||
|
}
|
||||||
|
|
||||||
if !*applyBalancing {
|
if !*applyBalancing {
|
||||||
fmt.Fprintf(writer, "collection %s will be deleted. Use -force to apply the change.\n", *collectionName)
|
fmt.Fprintf(writer, "collection '%s' will be deleted. Use -force to apply the change.\n", *collectionName)
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue