added basic commands
This commit is contained in:
34
main.go
34
main.go
@@ -4,19 +4,47 @@ import (
|
||||
"log"
|
||||
"os"
|
||||
"github.com/urfave/cli/v2"
|
||||
"fmt"
|
||||
)
|
||||
|
||||
// VERSION specifies the version of the platform
|
||||
var VERSION = "0.0.1"
|
||||
|
||||
func main() {
|
||||
var mode string
|
||||
|
||||
app := &cli.App{
|
||||
Name: "p2p-redering-computation",
|
||||
Usage: "allows you to batch tasks in a peer to peer network",
|
||||
Version: VERSION,
|
||||
/*Commands: []*cli.Command{
|
||||
cmd.CmdStart,
|
||||
},*/
|
||||
Flags: []cli.Flag {
|
||||
&cli.StringFlag{
|
||||
Name: "mode",
|
||||
Value: "client",
|
||||
Usage: "Specifies mode of running",
|
||||
Destination: &mode,
|
||||
},
|
||||
},
|
||||
Action: func(c *cli.Context) error {
|
||||
/*
|
||||
Example usage:
|
||||
name := "someone"
|
||||
if c.NArg() > 0 {
|
||||
name = c.Args().Get(0)
|
||||
}
|
||||
if language == "spanish" {
|
||||
fmt.Println("Hola", name)
|
||||
} else {
|
||||
fmt.Println("Hello", name)
|
||||
}
|
||||
return nil
|
||||
*/
|
||||
fmt.Println(mode)
|
||||
if c.NArg() < 0 {
|
||||
fmt.Println(c.Args().Get(0))
|
||||
}
|
||||
return nil
|
||||
},
|
||||
}
|
||||
|
||||
err := app.Run(os.Args)
|
||||
|
||||
Reference in New Issue
Block a user