Skip to content

Commit 2325523

Browse files
committed
Fix a very silly bug, thanks to e2e
1 parent 9248a00 commit 2325523

File tree

1 file changed

+4
-10
lines changed

1 file changed

+4
-10
lines changed

cmd/client/main.go

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -143,24 +143,18 @@ func main() {
143143
settings.ProxyUseHostKerberos = true
144144
}
145145

146-
if !(line.IsSet("d") || line.IsSet("destination")) && len(settings.Addr) == 0 && len(line.Arguments) < 1 {
147-
fmt.Println("No destination specified")
148-
printHelp()
149-
return
150-
}
151-
152146
tempDestination, err := line.GetArgString("d")
153147
if err != nil {
154148
tempDestination, _ = line.GetArgString("destination")
155149
}
156150

157151
if len(tempDestination) > 0 {
158-
destination = tempDestination
152+
settings.Addr = tempDestination
159153
}
160154

161-
if len(destination) == 0 && len(line.Arguments) > 1 {
155+
if len(settings.Addr) == 0 && len(line.Arguments) > 1 {
162156
// Basically take a guess at the arguments we have and take the last one
163-
destination = line.Arguments[len(line.Arguments)-1].Value()
157+
settings.Addr = line.Arguments[len(line.Arguments)-1].Value()
164158
}
165159

166160
var actualLogLevel logger.Urgency = logger.INFO
@@ -179,7 +173,7 @@ func main() {
179173
}
180174
logger.SetLogLevel(actualLogLevel)
181175

182-
if len(destination) == 0 {
176+
if len(settings.Addr) == 0 {
183177
fmt.Println("No destination specified")
184178
printHelp()
185179
return

0 commit comments

Comments
 (0)