http -> http bind, part 2 (#32)

This commit is contained in:
Michael Quigley 2022-08-18 17:13:38 -04:00
parent 73283660f8
commit bb55008451
No known key found for this signature in database
GPG Key ID: 9B60314A9DD20A62
2 changed files with 9 additions and 3 deletions

View File

@ -24,7 +24,7 @@ import (
)
func init() {
rootCmd.AddCommand(newHttpBindCommand().cmd)
httpCmd.AddCommand(newHttpBindCommand().cmd)
}
type httpBindCommand struct {
@ -35,8 +35,8 @@ type httpBindCommand struct {
func newHttpBindCommand() *httpBindCommand {
cmd := &cobra.Command{
Use: "http <endpoint>",
Short: "Start an HTTP terminator",
Use: "bind <endpoint>",
Short: "Create an HTTP binding",
Args: cobra.ExactArgs(1),
}
command := &httpBindCommand{cmd: cmd}

View File

@ -13,6 +13,7 @@ func init() {
pfxlog.GlobalInit(logrus.InfoLevel, pfxlog.DefaultOptions().SetTrimPrefix("github.com/openziti-test-kitchen/"))
rootCmd.PersistentFlags().BoolVarP(&verbose, "verbose", "v", false, "enable verbose logging")
rootCmd.PersistentFlags().StringVarP(&endpoint, "endpoint", "e", "localhost:10888", "zrok endpoint address")
rootCmd.AddCommand(httpCmd)
}
var rootCmd = &cobra.Command{
@ -27,6 +28,11 @@ var rootCmd = &cobra.Command{
var verbose bool
var endpoint string
var httpCmd = &cobra.Command{
Use: "http",
Short: "HTTP endpoint operations",
}
func main() {
if err := rootCmd.Execute(); err != nil {
panic(err)