Add a new flag to images pull for printing out the pulled image's chainID

Signed-off-by: Kathryn Baldauf <kabaldau@microsoft.com>
This commit is contained in:
Kathryn Baldauf
2020-12-14 16:00:52 -08:00
parent 23315f8647
commit 14df541a40
2 changed files with 29 additions and 0 deletions

View File

@@ -280,6 +280,10 @@ var prepareCommand = cli.Command{
Name: "target, t",
Usage: "mount target path, will print mount, if provided",
},
cli.BoolFlag{
Name: "mounts",
Usage: "Print out snapshot mounts as JSON",
},
},
Action: func(context *cli.Context) error {
if narg := context.NArg(); narg < 1 || narg > 2 {
@@ -310,6 +314,10 @@ var prepareCommand = cli.Command{
printMounts(target, mounts)
}
if context.Bool("mounts") {
commands.PrintAsJSON(mounts)
}
return nil
},
}
@@ -323,6 +331,10 @@ var viewCommand = cli.Command{
Name: "target, t",
Usage: "mount target path, will print mount, if provided",
},
cli.BoolFlag{
Name: "mounts",
Usage: "Print out snapshot mounts as JSON",
},
},
Action: func(context *cli.Context) error {
if narg := context.NArg(); narg < 1 || narg > 2 {
@@ -349,6 +361,10 @@ var viewCommand = cli.Command{
printMounts(target, mounts)
}
if context.Bool("mounts") {
commands.PrintAsJSON(mounts)
}
return nil
},
}