diff --git a/cli/cmd/aeon.go b/cli/cmd/aeon.go index d9e554ad4..77e310d77 100644 --- a/cli/cmd/aeon.go +++ b/cli/cmd/aeon.go @@ -6,6 +6,7 @@ import ( "fmt" "os" "path/filepath" + "regexp" "github.com/spf13/cobra" aeon "github.com/tarantool/tt/cli/aeon" @@ -91,7 +92,12 @@ func NewAeonCmd() *cobra.Command { func aeonConnectValidateArgs(cmd *cobra.Command, args []string) error { if len(args) != 0 { + fmt.Println("(args[0]", (args[0])) + connectCtx.Network, connectCtx.Address = libconnect.ParseBaseURI(args[0]) + + fmt.Println("connectCtx.Network", connectCtx.Network) + fmt.Println("connectCtx.Address", connectCtx.Address) } else if cmd.Flags().Changed("config") && cmd.Flags().Changed("instanceName") { f, err := os.ReadFile(configPath) if err != nil { @@ -119,13 +125,23 @@ func aeonConnectValidateArgs(cmd *cobra.Command, args []string) error { if err != nil { return err } - + + fmt.Println("URI", uri) + us, ok := uri.(string) if !ok { return fmt.Errorf("fail to conver string") } - connectCtx.Network, connectCtx.Address = libconnect.ParseBaseURI(us) + re := regexp.MustCompile("^https?://") + cleanedURL := re.ReplaceAllString(us, "") + + fmt.Println("US", us) + + connectCtx.Network, connectCtx.Address = libconnect.ParseBaseURI(cleanedURL) + + fmt.Println("connectCtx.Network", connectCtx.Network) + fmt.Println("connectCtx.Address", connectCtx.Address) } if !cmd.Flags().Changed("transport") && (connectCtx.Ssl.KeyFile != "" ||