Merge model,cli,docs polish for v0.1.0
# Conflicts: # internal/cli/commands_image.go
This commit is contained in:
commit
f7a6832ebf
6 changed files with 196 additions and 42 deletions
|
|
@ -891,7 +891,8 @@ Pipe into 'jq' for quick field extraction, e.g. banger vm stats dev | jq .mem.
|
|||
}
|
||||
|
||||
func (d *deps) newVMPortsCommand() *cobra.Command {
|
||||
return &cobra.Command{
|
||||
var jsonOut bool
|
||||
cmd := &cobra.Command{
|
||||
Use: "ports <id-or-name>",
|
||||
Short: "Show host-reachable listening guest ports",
|
||||
Args: exactArgsUsage(1, "usage: banger vm ports <id-or-name>"),
|
||||
|
|
@ -905,9 +906,14 @@ func (d *deps) newVMPortsCommand() *cobra.Command {
|
|||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if jsonOut {
|
||||
return printJSON(cmd.OutOrStdout(), result)
|
||||
}
|
||||
return printVMPortsTable(cmd.OutOrStdout(), result)
|
||||
},
|
||||
}
|
||||
cmd.Flags().BoolVar(&jsonOut, "json", false, "print ports as JSON instead of a table")
|
||||
return cmd
|
||||
}
|
||||
|
||||
type resolvedVMTarget struct {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue