diff options
| author | citrons <citrons@mondecitronne.com> | 2025-06-01 19:28:10 -0500 |
|---|---|---|
| committer | citrons <citrons@mondecitronne.com> | 2025-06-01 19:28:10 -0500 |
| commit | bd5aa344ee5c53e04d15d9fc615d5698b5dbcfea (patch) | |
| tree | 758b599e72710072dd0b552f8b7e9fff22fe3885 | |
| parent | a69d4d6bd2e9c91a8c9925610b46922d58eda493 (diff) | |
don't split args of single argument commands
| -rw-r--r-- | client/command.go | 15 |
1 files changed, 3 insertions, 12 deletions
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 ( |
