git » msnlib » commit d88c01b

Show your nick if the nick command is called without parameters.

author Alberto Bertogli
2005-11-09 20:52:41 UTC
committer Alberto Bertogli
2005-11-09 20:52:41 UTC
parent 5f8afa4efd3a1fde47b96bd5d803188b59da0fe3

Show your nick if the nick command is called without parameters.

This is based on Ben Clifford's patch.

msn +4 -3

diff --git a/msn b/msn
index 1e236bf..5da3c94 100644
--- a/msn
+++ b/msn
@@ -62,7 +62,7 @@ close nick	Closes the switchboard connection with "nick"
 config		Shows the configuration
 info [nick]	Shows the user information and pending messages (if any),
 		or our personal info
-nick newnick	Changes your nick to "newnick"
+nick [newnick]	Changes your nick to "newnick" or shows own nick
 privacy p a	Sets whether accept messages from people not on your list (p)
 		and require authorization (a)
 m nick text	Sends a message to "nick" with the "text"
@@ -1179,8 +1179,9 @@ def parse_cmd(cmd):
 			return 'No current chat with user %s' % dst
 		m.invite(email, dst_sbd)
 
-	elif cmd == 'nick':		# change our nick
-		if len(params) < 1: return 'Error parsing command'
+	elif cmd == 'nick':		# show or change our nick
+		if len(params) < 1:
+			return "Your current nick is: %s" % m.nick
 		nick = params
 		m.change_nick(nick)