Skip to content

Commit

Permalink
Merge pull request #11324 from vax-r:fix_usage_display
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 710763639
  • Loading branch information
gvisor-bot committed Dec 30, 2024
2 parents 0a28828 + 83f9f18 commit 1db44ea
Show file tree
Hide file tree
Showing 29 changed files with 30 additions and 48 deletions.
2 changes: 1 addition & 1 deletion runsc/cmd/boot.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
3 changes: 1 addition & 2 deletions runsc/cmd/checkpoint.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
3 changes: 1 addition & 2 deletions runsc/cmd/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion runsc/cmd/debug.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion runsc/cmd/delete.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion runsc/cmd/gofer.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
6 changes: 2 additions & 4 deletions runsc/cmd/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion runsc/cmd/kill.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion runsc/cmd/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
3 changes: 1 addition & 2 deletions runsc/cmd/metric_export.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
3 changes: 1 addition & 2 deletions runsc/cmd/metricserver/metricservercmd/metricservercmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
3 changes: 1 addition & 2 deletions runsc/cmd/nvproxy/list_supported_drivers.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion runsc/cmd/pause.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
3 changes: 1 addition & 2 deletions runsc/cmd/platforms.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
3 changes: 1 addition & 2 deletions runsc/cmd/restore.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
3 changes: 1 addition & 2 deletions runsc/cmd/resume.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
3 changes: 1 addition & 2 deletions runsc/cmd/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion runsc/cmd/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion runsc/cmd/state.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion runsc/cmd/statefile.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
3 changes: 1 addition & 2 deletions runsc/cmd/syscalls.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,7 @@ func (*Syscalls) Synopsis() string {

// Usage implements subcommands.Command.Usage.
func (*Syscalls) Usage() string {
return `syscalls [options] - Print compatibility information for syscalls.
`
return "syscalls [options] - Print compatibility information for syscalls.\n"
}

// SetFlags implements subcommands.Command.SetFlags.
Expand Down
3 changes: 1 addition & 2 deletions runsc/cmd/trace/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,7 @@ func (*create) Synopsis() string {

// Usage implements subcommands.Command.
func (*create) Usage() string {
return `create [flags] <sandbox id> - create a trace session
`
return "create [flags] <sandbox id> - create a trace session\n"
}

// SetFlags implements subcommands.Command.
Expand Down
3 changes: 1 addition & 2 deletions runsc/cmd/trace/delete.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,7 @@ func (*delete) Synopsis() string {

// Usage implements subcommands.Command.
func (*delete) Usage() string {
return `delete [flags] <sandbox id> - delete a trace session
`
return "delete [flags] <sandbox id> - delete a trace session\n"
}

// SetFlags implements subcommands.Command.
Expand Down
3 changes: 1 addition & 2 deletions runsc/cmd/trace/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,7 @@ func (*list) Synopsis() string {

// Usage implements subcommands.Command.
func (*list) Usage() string {
return `list - list all trace sessions
`
return "list - list all trace sessions\n"
}

// SetFlags implements subcommands.Command.
Expand Down
3 changes: 1 addition & 2 deletions runsc/cmd/trace/metadata.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,7 @@ func (*metadata) Synopsis() string {

// Usage implements subcommands.Command.
func (*metadata) Usage() string {
return `metadata - list all trace points configuration information
`
return "metadata - list all trace points configuration information\n"
}

// SetFlags implements subcommands.Command.
Expand Down
3 changes: 1 addition & 2 deletions runsc/cmd/trace/procfs.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,7 @@ func (*procfs) Synopsis() string {

// Usage implements subcommands.Command.
func (*procfs) Usage() string {
return `procfs <sandbox id> - get procfs dump for a trace session
`
return "procfs <sandbox id> - get procfs dump for a trace session\n"
}

// SetFlags implements subcommands.Command.
Expand Down
2 changes: 1 addition & 1 deletion runsc/cmd/umount_unsafe.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ func (*Umount) Synopsis() string {

// Usage implements subcommands.Command.Usage.
func (*Umount) Usage() string {
return `umount --sync-fd=FD <directory path>`
return "umount --sync-fd=FD <directory path>\n"
}

// SetFlags implements subcommands.Command.SetFlags.
Expand Down
3 changes: 1 addition & 2 deletions runsc/cmd/usage.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,7 @@ func (*Usage) Synopsis() string {

// Usage implements subcommands.Command.Usage.
func (*Usage) Usage() string {
return `usage [flags] <container id> - print memory usages to standard output.
`
return "usage [flags] <container id> - print memory usages to standard output.\n"
}

// SetFlags implements subcommands.Command.SetFlags.
Expand Down
2 changes: 1 addition & 1 deletion runsc/cmd/wait.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ func (*Wait) Synopsis() string {

// Usage implements subcommands.Command.Usage.
func (*Wait) Usage() string {
return `wait [flags] <container id>`
return "wait [flags] <container id>\n"
}

// SetFlags implements subcommands.Command.SetFlags.
Expand Down

0 comments on commit 1db44ea

Please sign in to comment.