提交 5169c053 编写于 作者: D Davies Liu

add --no-update to skip existing volume

上级 215e5199
......@@ -161,6 +161,12 @@ func format(c *cli.Context) error {
if compressor == nil {
logger.Fatalf("Unsupported compress algorithm: %s", c.String("compress"))
}
if c.Bool("no-update") {
if _, err := m.Load(); err == nil {
return nil
}
}
format := meta.Format{
Name: name,
UUID: uuid.New().String(),
......@@ -272,6 +278,10 @@ func formatFlags() *cli.Command {
Name: "force",
Usage: "overwrite existing format",
},
&cli.BoolFlag{
Name: "no-update",
Usage: "don't update existing volume",
},
},
Action: format,
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册