Skip to content

Commit 2507430

Browse files
author
Jose Bovet Derpich
committed
feat(connect): expand connectArgs to handle spaces in arguments
Signed-off-by: Jose Bovet Derpich <jose.bovet@walmart.com>
1 parent 34490ab commit 2507430

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

cmd/connect.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,17 @@ func runConnectCommand(cmd *cobra.Command, args []string) error {
7575
}
7676
}
7777

78+
// Expand connectArgs if any entry contains spaces (e.g., passed as a single string)
79+
if len(connectArgs) > 0 {
80+
var expandedArgs []string
81+
for _, arg := range connectArgs {
82+
// Split only if there are spaces and not already quoted
83+
fields := strings.Fields(arg)
84+
expandedArgs = append(expandedArgs, fields...)
85+
}
86+
config.Args = expandedArgs
87+
}
88+
7889
// Create the appropriate adapter
7990
adapterType := adapter.AdapterType(connectType)
8091
serverAdapter, err := adapter.NewAdapter(adapterType, config)

0 commit comments

Comments
 (0)