mirror of
https://github.com/abiosoft/colima.git
synced 2026-05-17 12:10:34 +00:00
ad5102e433
* cli: add --json flag to status command * chore: minor refactor * chore: minor refactor * chore: apply suggestions from code review * chore: apply suggestions from code review * chore: fix syntax error --------- Co-authored-by: Abiola Ibrahim <git@abiosoft.com>
30 lines
737 B
Go
30 lines
737 B
Go
package cmd
|
|
|
|
import (
|
|
"github.com/abiosoft/colima/cmd/root"
|
|
"github.com/spf13/cobra"
|
|
)
|
|
|
|
var statusCmdArgs struct {
|
|
extended bool
|
|
json bool
|
|
}
|
|
|
|
// statusCmd represents the status command
|
|
var statusCmd = &cobra.Command{
|
|
Use: "status [profile]",
|
|
Short: "show the status of Colima",
|
|
Long: `Show the status of Colima`,
|
|
Args: cobra.MaximumNArgs(1),
|
|
RunE: func(cmd *cobra.Command, args []string) error {
|
|
return newApp().Status(statusCmdArgs.extended, statusCmdArgs.json)
|
|
},
|
|
}
|
|
|
|
func init() {
|
|
root.Cmd().AddCommand(statusCmd)
|
|
|
|
statusCmd.Flags().BoolVarP(&statusCmdArgs.extended, "extended", "e", false, "include additional details")
|
|
statusCmd.Flags().BoolVarP(&statusCmdArgs.json, "json", "j", false, "print json output")
|
|
}
|