mirror of
https://github.com/clearlinux/docker.git
synced 2026-09-05 21:21:42 +00:00
pretty print json in inspect
This commit is contained in:
+8
-1
@@ -457,7 +457,14 @@ func CmdInspect(args ...string) error {
|
||||
return err
|
||||
}
|
||||
}
|
||||
fmt.Printf("%s\n", obj)
|
||||
|
||||
indented := new(bytes.Buffer)
|
||||
if err = json.Indent(indented, obj, "", " "); err != nil {
|
||||
return err
|
||||
}
|
||||
if _, err := io.Copy(os.Stdout, indented); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user