mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
feat(cli): add shell completions (#14341)
This commit is contained in:
+10
-10
@@ -32,11 +32,11 @@ func (r *RootCmd) stat() *serpent.Command {
|
||||
fs = afero.NewReadOnlyFs(afero.NewOsFs())
|
||||
formatter = cliui.NewOutputFormatter(
|
||||
cliui.TableFormat([]statsRow{}, []string{
|
||||
"host_cpu",
|
||||
"host_memory",
|
||||
"home_disk",
|
||||
"container_cpu",
|
||||
"container_memory",
|
||||
"host cpu",
|
||||
"host memory",
|
||||
"home disk",
|
||||
"container cpu",
|
||||
"container memory",
|
||||
}),
|
||||
cliui.JSONFormat(),
|
||||
)
|
||||
@@ -284,9 +284,9 @@ func (*RootCmd) statDisk(fs afero.Fs) *serpent.Command {
|
||||
}
|
||||
|
||||
type statsRow struct {
|
||||
HostCPU *clistat.Result `json:"host_cpu" table:"host_cpu,default_sort"`
|
||||
HostMemory *clistat.Result `json:"host_memory" table:"host_memory"`
|
||||
Disk *clistat.Result `json:"home_disk" table:"home_disk"`
|
||||
ContainerCPU *clistat.Result `json:"container_cpu" table:"container_cpu"`
|
||||
ContainerMemory *clistat.Result `json:"container_memory" table:"container_memory"`
|
||||
HostCPU *clistat.Result `json:"host_cpu" table:"host cpu,default_sort"`
|
||||
HostMemory *clistat.Result `json:"host_memory" table:"host memory"`
|
||||
Disk *clistat.Result `json:"home_disk" table:"home disk"`
|
||||
ContainerCPU *clistat.Result `json:"container_cpu" table:"container cpu"`
|
||||
ContainerMemory *clistat.Result `json:"container_memory" table:"container memory"`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user