Skip to content
Snippets Groups Projects
Commit 49047cfb authored by Loïck Bonniot's avatar Loïck Bonniot
Browse files

[client] Add client kernel

This adds `help` and `version` commands to the dfss client
TG-241 #ready
parent 35e6bc2d
No related branches found
No related tags found
1 merge request!6174 kernels
Pipeline #
...@@ -38,6 +38,7 @@ Code lint: ...@@ -38,6 +38,7 @@ Code lint:
- golang - golang
- lint - lint
script: script:
- "go install ./..."
- "go get github.com/alecthomas/gometalinter" - "go get github.com/alecthomas/gometalinter"
- "go get gopkg.in/mgo.v2" - "go get gopkg.in/mgo.v2"
- "gometalinter --install" - "gometalinter --install"
......
package main
import (
"dfss"
"flag"
"fmt"
"runtime"
)
var (
verbose bool
)
func init() {
flag.BoolVar(&verbose, "v", false, "Print verbose messages")
flag.Usage = func() {
fmt.Println("DFSS client command line v" + dfss.Version)
fmt.Println("A tool to sign multiparty contracts")
fmt.Println("\nUsage:")
fmt.Println(" dfssc command [flags]")
fmt.Println("\nThe commands are:")
fmt.Println(" help print this help")
fmt.Println(" version print dfss client version")
fmt.Println("\nFlags:")
flag.PrintDefaults()
fmt.Println()
}
}
func main() {
flag.Parse()
command := flag.Arg(0)
switch command {
case "version":
fmt.Println("v"+dfss.Version, runtime.GOOS, runtime.GOARCH)
default:
flag.Usage()
}
}
package dfss
// Version represents the current version of the DFSS software suite
const Version = "0.0.1-dev"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment