add display server specs and added common print function
This commit is contained in:
@@ -42,7 +42,18 @@ var CliAction = func(ctx *cli.Context) error {
|
||||
if err != nil {
|
||||
fmt.Print(err)
|
||||
}
|
||||
client.PrintStartContainer(imageRes)
|
||||
client.PrettyPrint(imageRes)
|
||||
}
|
||||
|
||||
//Call if specs flag is called
|
||||
if Specs != "" {
|
||||
specs, err := client.GetSpecs(Specs)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// Pretty print
|
||||
client.PrettyPrint(specs)
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -9,6 +9,7 @@ var (
|
||||
IpAddress string
|
||||
Ports string
|
||||
Mode string
|
||||
Specs string
|
||||
GPU bool
|
||||
ListServers bool
|
||||
)
|
||||
@@ -46,4 +47,10 @@ var AppConfigFlags = []cli.Flag{
|
||||
EnvVars: []string{"USE_GPU"},
|
||||
Destination: &GPU,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "Specs",
|
||||
Usage: "Specs of the server node",
|
||||
EnvVars: []string{"SPECS"},
|
||||
Destination: &Specs,
|
||||
},
|
||||
}
|
||||
Reference in New Issue
Block a user