MCPcopy Create free account
hub / github.com/containerd/nerdctl / InspectContainerCommand

Function InspectContainerCommand

pkg/formatter/formatter.go:76–89  ·  view source on GitHub ↗
(spec *oci.Spec, trunc, quote bool)

Source from the content-addressed store, hash-verified

74}
75
76func InspectContainerCommand(spec *oci.Spec, trunc, quote bool) string {
77 if spec == nil || spec.Process == nil {
78 return ""
79 }
80
81 command := spec.Process.CommandLine + strings.Join(spec.Process.Args, " ")
82 if trunc {
83 command = Ellipsis(command, 20)
84 }
85 if quote {
86 command = strconv.Quote(command)
87 }
88 return command
89}
90
91func InspectContainerCommandTrunc(spec *oci.Spec) string {
92 return InspectContainerCommand(spec, true, true)

Callers 3

prepareContainersFunction · 0.92

Calls 1

EllipsisFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…