Monorepo-ize stuff

This commit is contained in:
Netscape Navigator 2020-09-08 07:53:16 -05:00
parent 75b6f60207
commit 5d946ac9a0
3 changed files with 39 additions and 1 deletions

View File

@ -50,7 +50,7 @@ go test -v ./...
With coverage:
```
go test -v ./... -coverprofile coverage.out
go test -coverprofile coverage.out
go tool cover -html=coverage.out
```

37
cli.go Normal file
View File

@ -0,0 +1,37 @@
package main
import (
"fmt"
"os"
"github.com/spf13/cobra"
)
var rootCmd = &cobra.Command{
Use: "pigeon",
Short: "Pigeon is a peer-to-peer database for offline systems",
Long: `Pigeon is an off-grid, serverless, peer-to-peer
database for building software that works on poor internet
connections, or entirely offline.`,
Run: func(cmd *cobra.Command, args []string) {
fmt.Println("It works!")
},
}
var versionCmd = &cobra.Command{
Use: "version",
Short: "This is the short description of version",
Long: `This one is longer.`,
Run: func(cmd *cobra.Command, args []string) {
fmt.Printf("Pigeon CLI Client (Golang), version %s\n", Version)
},
}
// BootstrapCLI wires up all the relevant commands.
func BootstrapCLI() {
rootCmd.AddCommand(versionCmd)
if err := rootCmd.Execute(); err != nil {
fmt.Println(err)
os.Exit(1)
}
}

View File

@ -1,4 +1,5 @@
package main
func main() {
BootstrapCLI()
}