From bd5aa344ee5c53e04d15d9fc615d5698b5dbcfea Mon Sep 17 00:00:00 2001 From: citrons Date: Sun, 1 Jun 2025 19:28:10 -0500 Subject: don't split args of single argument commands --- client/command.go | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) (limited to 'client') diff --git a/client/command.go b/client/command.go index 3dc3d26..253cf59 100644 --- a/client/command.go +++ b/client/command.go @@ -63,11 +63,8 @@ func (a *application) doCommand(command string, args []string, text string) { case "nick": a.setNick(text) case "join": - if !argN(1) { - break - } if a.authenticated { - a.join(args[0]) + a.join(text) } case "leave": if !argN(0) { @@ -80,13 +77,10 @@ func (a *application) doCommand(command string, args []string, text string) { } a.currentWindow = cmdWindowLocation {} case "rename": - if !argN(1) { - break - } win := a.windowCache.Get(a.currentWindow) switch win.(type) { case *channelWindow: - win.(*channelWindow).renameChannel(args[0]) + win.(*channelWindow).renameChannel(text) } case "list": if !argN(0) { @@ -100,11 +94,8 @@ func (a *application) doCommand(command string, args []string, text string) { }) } case "create": - if !argN(1) { - break - } if a.authenticated { - a.createChannel(args[0]) + a.createChannel(text) } case "help": var ( -- cgit v1.2.3