|
| 1 | +// ______ _ ______ _ _ |
| 2 | +// | _ \ | | | _ (_) | | |
| 3 | +// | | | |__ _| |_ __ _ | | | |_ ___ __| | ___ |
| 4 | +// | | | / _` | __/ _` | | | | | |/ _ \ / _` |/ _ \ |
| 5 | +// | |/ / (_| | || (_| | | |/ /| | (_) | (_| | __/ |
| 6 | +// |___/ \__,_|\__\__,_| |___/ |_|\___/ \__,_|\___| |
| 7 | + |
| 8 | +package main |
| 9 | + |
| 10 | +import ( |
| 11 | + "fmt" |
| 12 | + "log" |
| 13 | + "os" |
| 14 | + |
| 15 | + "github.com/urfave/cli/v2" |
| 16 | + "rsc.io/quote" |
| 17 | +) |
| 18 | + |
| 19 | +func main () { |
| 20 | + app := &cli.App{ |
| 21 | + Name: "diode", |
| 22 | + Usage: "A command line tool for interacting with data diodes.", |
| 23 | + Action: func(cCtx *cli.Context) error { |
| 24 | + fmt.Println(quote.Go()) |
| 25 | + return nil |
| 26 | + }, |
| 27 | + Commands: []*cli.Command{ |
| 28 | + { |
| 29 | + Name: "client", |
| 30 | + Aliases: []string{"c"}, |
| 31 | + Usage: "Input side of the data diode", |
| 32 | + Action: func(cCtx *cli.Context) error { |
| 33 | + fmt.Println(">> INPUT") |
| 34 | + return nil |
| 35 | + }, |
| 36 | + }, |
| 37 | + { |
| 38 | + Name: "server", |
| 39 | + Aliases: []string{"s"}, |
| 40 | + Usage: "Output side of the data diode", |
| 41 | + Action: func(sCtx *cli.Context) error { |
| 42 | + fmt.Println(">> OUTPUT") |
| 43 | + return nil |
| 44 | + }, |
| 45 | + }, |
| 46 | + { |
| 47 | + Name: "diagnostics", |
| 48 | + Aliases: []string{"d"}, |
| 49 | + Usage: "Debug diagnostics via configuration settings", |
| 50 | + Action: func(dCtx *cli.Context) error { |
| 51 | + fmt.Println(">> DIAGNOSTICS") |
| 52 | + return nil |
| 53 | + }, |
| 54 | + }, |
| 55 | + { |
| 56 | + Name: "benchmark", |
| 57 | + Aliases: []string{"b"}, |
| 58 | + Usage: "System benchmark analysis + report performance metrics", |
| 59 | + Action: func(bCtx *cli.Context) error { |
| 60 | + fmt.Println(">> BENCHMARKS") |
| 61 | + return nil |
| 62 | + }, |
| 63 | + }, |
| 64 | + { |
| 65 | + Name: "version", |
| 66 | + Aliases: []string{"v"}, |
| 67 | + Usage: "Print the version of the diode CLI", |
| 68 | + Action: func(vCtx *cli.Context) error { |
| 69 | + fmt.Println(">> diode version 0.0.1") |
| 70 | + return nil |
| 71 | + }, |
| 72 | + }, |
| 73 | + }, |
| 74 | + } |
| 75 | + |
| 76 | + if err := app.Run(os.Args); err != nil { |
| 77 | + log.Fatal() |
| 78 | + } |
| 79 | +} |
0 commit comments