summaryrefslogtreecommitdiffhomepage
path: root/runsc/cmd
diff options
context:
space:
mode:
authorgVisor bot <gvisor-bot@google.com>2021-08-04 23:48:28 +0000
committergVisor bot <gvisor-bot@google.com>2021-08-04 23:48:28 +0000
commita1356634b1f3f89aee4acd2b7966df31b29fb97c (patch)
treecb1b8ed2b70e627c99186e904f1f3c5493015119 /runsc/cmd
parente6ce797f3838622a396586f4f85b78241af85c64 (diff)
parentcbb99336cee7d37f4050875a95946ca88b7ac690 (diff)
Merge release-20210726.0-32-gcbb99336c (automated)
Diffstat (limited to 'runsc/cmd')
-rw-r--r--runsc/cmd/debug.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/runsc/cmd/debug.go b/runsc/cmd/debug.go
index da81cf048..f773ccca0 100644
--- a/runsc/cmd/debug.go
+++ b/runsc/cmd/debug.go
@@ -48,6 +48,7 @@ type Debug struct {
delay time.Duration
duration time.Duration
ps bool
+ cat stringSlice
}
// Name implements subcommands.Command.
@@ -81,6 +82,7 @@ func (d *Debug) SetFlags(f *flag.FlagSet) {
f.StringVar(&d.logLevel, "log-level", "", "The log level to set: warning (0), info (1), or debug (2).")
f.StringVar(&d.logPackets, "log-packets", "", "A boolean value to enable or disable packet logging: true or false.")
f.BoolVar(&d.ps, "ps", false, "lists processes")
+ f.Var(&d.cat, "cat", "reads files and print to standard output")
}
// Execute implements subcommands.Command.Execute.
@@ -367,5 +369,11 @@ func (d *Debug) Execute(_ context.Context, f *flag.FlagSet, args ...interface{})
return subcommands.ExitFailure
}
+ if d.cat != nil {
+ if err := c.Cat(d.cat, os.Stdout); err != nil {
+ return Errorf("Cat failed: %v", err)
+ }
+ }
+
return subcommands.ExitSuccess
}