Skip to content

Commit 1578d5f

Browse files
committed
feat: initial template for CLI tool
1 parent 72b5621 commit 1578d5f

File tree

5 files changed

+104
-25
lines changed

5 files changed

+104
-25
lines changed

acep-dcm-kea.go

-20
This file was deleted.

data-diode

-1.94 MB
Binary file not shown.

go.mod

+11-5
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,16 @@
1-
module github.com/acep-uaf/data-diode
1+
module acep-uaf/cli/diode
22

3-
go 1.21.0
3+
go 1.21.4
44

5-
require rsc.io/quote v1.5.2
5+
require (
6+
github.com/urfave/cli/v2 v2.25.7
7+
rsc.io/quote v1.5.2
8+
)
69

710
require (
8-
golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c // indirect
9-
rsc.io/sampler v1.3.0 // indirect
11+
github.com/cpuguy83/go-md2man/v2 v2.0.3 // indirect
12+
github.com/russross/blackfriday/v2 v2.1.0 // indirect
13+
github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 // indirect
14+
golang.org/x/text v0.14.0 // indirect
15+
rsc.io/sampler v1.99.99 // indirect
1016
)

go.sum

+14
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,20 @@
1+
github.com/cpuguy83/go-md2man/v2 v2.0.2 h1:p1EgwI/C7NhT0JmVkwCD2ZBK8j4aeHQX2pMHHBfMQ6w=
2+
github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
3+
github.com/cpuguy83/go-md2man/v2 v2.0.3 h1:qMCsGGgs+MAzDFyp9LpAe1Lqy/fY/qCovCm0qnXZOBM=
4+
github.com/cpuguy83/go-md2man/v2 v2.0.3/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
5+
github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk=
6+
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
7+
github.com/urfave/cli/v2 v2.25.7 h1:VAzn5oq403l5pHjc4OhD54+XGO9cdKVL/7lDjF+iKUs=
8+
github.com/urfave/cli/v2 v2.25.7/go.mod h1:8qnjx1vcq5s2/wpsqoZFndg2CE5tNFyrTvS6SinrnYQ=
9+
github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 h1:bAn7/zixMGCfxrRTfdpNzjtPYqr8smhKouy9mxVdGPU=
10+
github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673/go.mod h1:N3UwUGtsrSj3ccvlPHLoLsHnpR27oXr4ZE984MbSER8=
111
golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c h1:qgOY6WgZOaTkIIMiVjBQcw93ERBE4m30iBm00nkL0i8=
212
golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
13+
golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ=
14+
golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
315
rsc.io/quote v1.5.2 h1:w5fcysjrx7yqtD/aO+QwRjYZOKnaM9Uh2b40tElTs3Y=
416
rsc.io/quote v1.5.2/go.mod h1:LzX7hefJvL54yjefDEDHNONDjII0t9xZLPXsUe+TKr0=
517
rsc.io/sampler v1.3.0 h1:7uVkIFmeBqHfdjD+gZwtXXI+RODJ2Wc4O7MPEh/QiW4=
618
rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA=
19+
rsc.io/sampler v1.99.99 h1:7i08f/p5TBU5joCPW3GjWG1ZFCmr28ybGqlXtelhEK8=
20+
rsc.io/sampler v1.99.99/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA=

testbed.go

+79
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
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

Comments
 (0)