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

View File

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