run command for client side added

This commit is contained in:
2020-12-26 22:39:38 +04:00
parent f82ca62038
commit c8b1a5bbba
2 changed files with 34 additions and 5 deletions

37
main.go
View File

@@ -9,9 +9,12 @@ import (
// VERSION specifies the version of the platform
var VERSION = "0.0.1"
var mode string
// Varaibles if mode is client
var OS, Pull_location ,Run_script string
func main() {
var mode string
app := &cli.App{
Name: "p2p-redering-computation",
@@ -24,6 +27,33 @@ func main() {
Usage: "Specifies mode of running",
Destination: &mode,
},
/*
Flags if the client mode is selected:
------------------------------------------------------------------
OS: Operating system name to create the VM
Pull Location: Location to pull the OS image
run script: Script to run the task (i.e binary file preferred)
------------------------------------------------------------------
*/
&cli.StringFlag{
Name: "OS",
Value: "ubuntu",
Usage: "Operating system name to create the VM",
Destination: &OS,
},
&cli.StringFlag{
Name: "Pull_location",
Value: "http://releases.ubuntu.com/14.04.3/ubuntu-14.04.3-server-amd64.iso",
Usage: "Location to pull the OS image",
Destination: &Pull_location,
},
&cli.StringFlag{
Name: "Run_script",
Value: "None",
Usage: "Script to run the task (i.e binary file preferred)",
Destination: &Run_script,
},
},
Action: func(c *cli.Context) error {
/*
@@ -39,9 +69,8 @@ func main() {
}
return nil
*/
fmt.Println(mode)
if c.NArg() < 0 {
fmt.Println(c.Args().Get(0))
if Run_script == "None" {
fmt.Println("script not excuted as run script not selected")
}
return nil
},