add display server specs and added common print function

This commit is contained in:
2021-04-10 02:23:20 +04:00
parent 27e270f77b
commit 30c126da91
11 changed files with 71 additions and 75 deletions

View File

@@ -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)
}

View File

@@ -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,
},
}