mirror of
https://github.com/netbirdio/gvisor.git
synced 2026-05-22 17:12:49 -07:00
runsc: Fix newline for cmd usage display
Originally, some of the commands' usage display didn't achieved to show newline, while some of them does, which are more user-friendly, and won't confuse the message if there're more which should be in the nextline. Fix this issue by returning usage string with a newline. Signed-off-by: I Hsin Cheng <richard120310@gmail.com>
This commit is contained in:
+1
-1
@@ -201,7 +201,7 @@ func (*Boot) Synopsis() string {
|
||||
|
||||
// Usage implements subcommands.Command.Usage.
|
||||
func (*Boot) Usage() string {
|
||||
return `boot [flags] <container id>`
|
||||
return "boot [flags] <container id>\n"
|
||||
}
|
||||
|
||||
// SetFlags implements subcommands.Command.SetFlags.
|
||||
|
||||
@@ -55,8 +55,7 @@ func (*Checkpoint) Synopsis() string {
|
||||
|
||||
// Usage implements subcommands.Command.Usage.
|
||||
func (*Checkpoint) Usage() string {
|
||||
return `checkpoint [flags] <container id> - save current state of container.
|
||||
`
|
||||
return "checkpoint [flags] <container id> - save current state of container.\n"
|
||||
}
|
||||
|
||||
// SetFlags implements subcommands.Command.SetFlags.
|
||||
|
||||
+1
-2
@@ -62,8 +62,7 @@ func (*Create) Synopsis() string {
|
||||
|
||||
// Usage implements subcommands.Command.Usage.
|
||||
func (*Create) Usage() string {
|
||||
return `create [flags] <container id> - create a secure container
|
||||
`
|
||||
return "create [flags] <container id> - create a secure container\n"
|
||||
}
|
||||
|
||||
// SetFlags implements subcommands.Command.SetFlags.
|
||||
|
||||
+1
-1
@@ -64,7 +64,7 @@ func (*Debug) Synopsis() string {
|
||||
|
||||
// Usage implements subcommands.Command.
|
||||
func (*Debug) Usage() string {
|
||||
return `debug [flags] <container id>`
|
||||
return "debug [flags] <container id>\n"
|
||||
}
|
||||
|
||||
// SetFlags implements subcommands.Command.
|
||||
|
||||
+1
-1
@@ -45,7 +45,7 @@ func (*Delete) Synopsis() string {
|
||||
|
||||
// Usage implements subcommands.Command.Usage.
|
||||
func (*Delete) Usage() string {
|
||||
return `delete [flags] <container ids>`
|
||||
return "delete [flags] <container ids>\n"
|
||||
}
|
||||
|
||||
// SetFlags implements subcommands.Command.SetFlags.
|
||||
|
||||
+1
-1
@@ -112,7 +112,7 @@ func (g *Gofer) Synopsis() string {
|
||||
|
||||
// Usage implements subcommands.Command.
|
||||
func (*Gofer) Usage() string {
|
||||
return `gofer [flags]`
|
||||
return "gofer [flags]\n"
|
||||
}
|
||||
|
||||
// SetFlags implements subcommands.Command.
|
||||
|
||||
@@ -52,8 +52,7 @@ func (*Install) Synopsis() string {
|
||||
|
||||
// Usage implements subcommands.Command.Usage.
|
||||
func (*Install) Usage() string {
|
||||
return `install [--runtime=<name>] [flags] [-- [args...]] -- if provided, args are passed to the runtime
|
||||
`
|
||||
return "install [--runtime=<name>] [flags] [-- [args...]] -- if provided, args are passed to the runtime\n"
|
||||
}
|
||||
|
||||
// SetFlags implements subcommands.Command.SetFlags.
|
||||
@@ -212,8 +211,7 @@ func (*Uninstall) Synopsis() string {
|
||||
|
||||
// Usage implements subcommands.Command.Usage.
|
||||
func (*Uninstall) Usage() string {
|
||||
return `uninstall [flags] <name>
|
||||
`
|
||||
return "uninstall [flags] <name>\n"
|
||||
}
|
||||
|
||||
// SetFlags implements subcommands.Command.SetFlags.
|
||||
|
||||
+1
-1
@@ -46,7 +46,7 @@ func (*Kill) Synopsis() string {
|
||||
|
||||
// Usage implements subcommands.Command.Usage.
|
||||
func (*Kill) Usage() string {
|
||||
return `kill <container id> [signal]`
|
||||
return "kill <container id> [signal]\n"
|
||||
}
|
||||
|
||||
// SetFlags implements subcommands.Command.SetFlags.
|
||||
|
||||
+1
-1
@@ -51,7 +51,7 @@ func (*List) Synopsis() string {
|
||||
|
||||
// Usage implements subcommands.Command.Usage.
|
||||
func (*List) Usage() string {
|
||||
return `list [flags]`
|
||||
return "list [flags]\n"
|
||||
}
|
||||
|
||||
// SetFlags implements subcommands.Command.SetFlags.
|
||||
|
||||
@@ -47,8 +47,7 @@ func (*MetricExport) Synopsis() string {
|
||||
|
||||
// Usage implements subcommands.Command.Usage.
|
||||
func (*MetricExport) Usage() string {
|
||||
return `export-metrics [-exporter-prefix=<runsc_>] <container id> - prints sandbox metric data in Prometheus metric format
|
||||
`
|
||||
return "export-metrics [-exporter-prefix=<runsc_>] <container id> - prints sandbox metric data in Prometheus metric format\n"
|
||||
}
|
||||
|
||||
// SetFlags implements subcommands.Command.SetFlags.
|
||||
|
||||
@@ -39,8 +39,7 @@ func (*Cmd) Synopsis() string {
|
||||
|
||||
// Usage implements subcommands.Command.Usage.
|
||||
func (*Cmd) Usage() string {
|
||||
return `-root=<root dir> -metric-server=<addr> metric-server [-exporter-prefix=<runsc_>]
|
||||
`
|
||||
return "-root=<root dir> -metric-server=<addr> metric-server [-exporter-prefix=<runsc_>]\n"
|
||||
}
|
||||
|
||||
// SetFlags implements subcommands.Command.SetFlags.
|
||||
|
||||
@@ -39,8 +39,7 @@ func (*listSupportedDrivers) Synopsis() string {
|
||||
|
||||
// Usage implements subcommands.Command.
|
||||
func (*listSupportedDrivers) Usage() string {
|
||||
return `list-supported-drivers - list all nvidia driver versions supported by nvproxy
|
||||
`
|
||||
return "list-supported-drivers - list all nvidia driver versions supported by nvproxy\n"
|
||||
}
|
||||
|
||||
// SetFlags implements subcommands.Command.
|
||||
|
||||
+1
-1
@@ -39,7 +39,7 @@ func (*Pause) Synopsis() string {
|
||||
|
||||
// Usage implements subcommands.Command.Usage.
|
||||
func (*Pause) Usage() string {
|
||||
return `pause <container id> - pause process in instance of container.`
|
||||
return "pause <container id> - pause process in instance of container.\n"
|
||||
}
|
||||
|
||||
// SetFlags implements subcommands.Command.SetFlags.
|
||||
|
||||
@@ -39,8 +39,7 @@ func (*Platforms) Synopsis() string {
|
||||
|
||||
// Usage implements subcommands.Command.Usage.
|
||||
func (*Platforms) Usage() string {
|
||||
return `platforms [options] - Print available platforms.
|
||||
`
|
||||
return "platforms [options] - Print available platforms.\n"
|
||||
}
|
||||
|
||||
// SetFlags implements subcommands.Command.SetFlags.
|
||||
|
||||
@@ -67,8 +67,7 @@ func (*Restore) Synopsis() string {
|
||||
|
||||
// Usage implements subcommands.Command.Usage.
|
||||
func (*Restore) Usage() string {
|
||||
return `restore [flags] <container id> - restore saved state of container.
|
||||
`
|
||||
return "restore [flags] <container id> - restore saved state of container.\n"
|
||||
}
|
||||
|
||||
// SetFlags implements subcommands.Command.SetFlags.
|
||||
|
||||
+1
-2
@@ -39,8 +39,7 @@ func (*Resume) Synopsis() string {
|
||||
|
||||
// Usage implements subcommands.Command.Usage.
|
||||
func (*Resume) Usage() string {
|
||||
return `resume <container id> - resume a paused container.
|
||||
`
|
||||
return "resume <container id> - resume a paused container.\n"
|
||||
}
|
||||
|
||||
// SetFlags implements subcommands.Command.SetFlags.
|
||||
|
||||
+1
-2
@@ -56,8 +56,7 @@ func (*Run) Synopsis() string {
|
||||
|
||||
// Usage implements subcommands.Command.Usage.
|
||||
func (*Run) Usage() string {
|
||||
return `run [flags] <container id> - create and run a secure container.
|
||||
`
|
||||
return "run [flags] <container id> - create and run a secure container.\n"
|
||||
}
|
||||
|
||||
// SetFlags implements subcommands.Command.SetFlags.
|
||||
|
||||
+1
-1
@@ -40,7 +40,7 @@ func (*Start) Synopsis() string {
|
||||
|
||||
// Usage implements subcommands.Command.Usage.
|
||||
func (*Start) Usage() string {
|
||||
return `start <container id> - start a secure container.`
|
||||
return "start <container id> - start a secure container.\n"
|
||||
}
|
||||
|
||||
// SetFlags implements subcommands.Command.SetFlags.
|
||||
|
||||
+1
-1
@@ -42,7 +42,7 @@ func (*State) Synopsis() string {
|
||||
|
||||
// Usage implements subcommands.Command.Usage.
|
||||
func (*State) Usage() string {
|
||||
return `state [flags] <container id> - get the state of a container`
|
||||
return "state [flags] <container id> - get the state of a container\n"
|
||||
}
|
||||
|
||||
// SetFlags implements subcommands.Command.SetFlags.
|
||||
|
||||
@@ -47,7 +47,7 @@ func (*Statefile) Synopsis() string {
|
||||
|
||||
// Usage implements subcommands.Command.
|
||||
func (*Statefile) Usage() string {
|
||||
return `statefile [flags] <statefile>`
|
||||
return "statefile [flags] <statefile>\n"
|
||||
}
|
||||
|
||||
// SetFlags implements subcommands.Command.
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user