Index: doc/user-guide/commands.xml
===================================================================
--- doc/user-guide/commands.xml	(revision 00fd005cd04ce4f68ff2d72de75a313868564f54)
+++ doc/user-guide/commands.xml	(revision 060d0661ff8c1465f394c307d0f4c2a22964c6b2)
@@ -25,5 +25,5 @@
 
 				<para>
-					If you omit the password, you should use the IRC /OPER command to enter it separately. The advantage of this approach is that most IRC clients will not show OPER passwords on screen/save them in logs.
+					You can omit the password and enter it separately using the IRC /OPER command. This lets you enter your password without your IRC client echoing it on screen or recording it in logs.
 				</para>
 			</description>
@@ -1604,5 +1604,5 @@
 	<bitlbee-command name="register">
 		<short-description>Register yourself</short-description>
-		<syntax>register &lt;password&gt;</syntax>
+		<syntax>register [&lt;password&gt;]</syntax>
 
 		<description>
@@ -1618,4 +1618,8 @@
 				To identify yourself in later sessions, you can use the <emphasis>identify</emphasis> command. To change your password later, you can use the <emphasis>set password</emphasis> command.
 			</para>
+
+			<para>
+				You can omit the password and enter it separately using the IRC /OPER command. This lets you enter your password without your IRC client echoing it on screen or recording it in logs.
+			</para>
 		</description>
 
@@ -1623,5 +1627,5 @@
 
 	<bitlbee-command name="identify">
-		<syntax>identify [-noload|-force] &lt;password&gt;</syntax>
+		<syntax>identify [-noload|-force] [&lt;password&gt;]</syntax>
 		<short-description>Identify yourself with your password</short-description>
 
@@ -1641,4 +1645,8 @@
 			<para>
 				<emphasis>-noload</emphasis> will log you in but not load any accounts and settings saved under your current nickname. These will be overwritten once you save your settings (i.e. when you disconnect).
+			</para>
+
+			<para>
+				You can omit the password and enter it separately using the IRC /OPER command. This lets you enter your password without your IRC client echoing it on screen or recording it in logs.
 			</para>
 		</description>
Index: irc.h
===================================================================
--- irc.h	(revision 00fd005cd04ce4f68ff2d72de75a313868564f54)
+++ irc.h	(revision 060d0661ff8c1465f394c307d0f4c2a22964c6b2)
@@ -50,4 +50,14 @@
 	USTATUS_SHUTDOWN = 8,   /* Now used to indicate we're shutting down.
 	                           Currently just blocks irc_vawrite(). */
+
+	/* Not really status stuff, but other kinds of flags: For slightly
+	   better password security, since the only way to send passwords
+	   to the IRC server securely (i.e. not echoing to screen or written
+	   to logfiles) is the /OPER command, try to use that command for
+	   stuff that matters. */
+	OPER_HACK_IDENTIFY = 0x100,
+	OPER_HACK_REGISTER = 0x200,
+	OPER_HACK_ACCOUNT_ADD = 0x400,
+	OPER_HACK_ANY = 0x700,	/* To check for them all at once. */
 } irc_status_t;
 
Index: irc_commands.c
===================================================================
--- irc_commands.c	(revision 00fd005cd04ce4f68ff2d72de75a313868564f54)
+++ irc_commands.c	(revision 060d0661ff8c1465f394c307d0f4c2a22964c6b2)
@@ -397,24 +397,11 @@
 }
 
-
+static void irc_cmd_oper_hack( irc_t *irc, char **cmd );
 
 static void irc_cmd_oper( irc_t *irc, char **cmd )
 {
-	account_t *a;
-	
-	/* /OPER can now also be used to enter IM passwords without echoing.
-	   It's a hack but the extra password security is worth it. */
-	for( a = irc->b->accounts; a; a = a->next )
-		if( strcmp( a->pass, PASSWORD_PENDING ) == 0 )
-		{
-			set_setstr( &a->set, "password", cmd[2] );
-			irc_usermsg( irc, "Password added to IM account "
-			             "%s(%s)", a->prpl->name, a->user );
-			/* The IRC client may expect this. Report failure since
-			   we didn't hand out a +o. */
-			irc_send_num( irc, 491, ":Password added to IM account "
-			              "%s(%s)", a->prpl->name, a->user );
-			return;
-		}
+	/* Very non-standard evil but useful/secure hack, see below. */
+	if( irc->status & OPER_HACK_ANY )
+		return irc_cmd_oper_hack( irc, cmd );
 	
 	if( global.conf->oper_pass &&
@@ -430,4 +417,44 @@
 		irc_send_num( irc, 491, ":Incorrect password" );
 	}
+}
+
+static void irc_cmd_oper_hack( irc_t *irc, char **cmd )
+{
+	char *password = g_strjoinv( " ", cmd + 2 );
+	
+	/* /OPER can now also be used to enter IM/identify passwords without
+	   echoing. It's a hack but the extra password security is worth it. */
+	if( irc->status & OPER_HACK_ACCOUNT_ADD )
+	{
+		account_t *a;
+		
+		for( a = irc->b->accounts; a; a = a->next )
+			if( strcmp( a->pass, PASSWORD_PENDING ) == 0 )
+			{
+				set_setstr( &a->set, "password", password );
+				irc_usermsg( irc, "Password added to IM account "
+				             "%s(%s)", a->prpl->name, a->user );
+				/* The IRC client may expect this. 491 suggests the OPER
+				   password was wrong, so the client won't expect a +o.
+				   It may however repeat the password prompt. We'll see. */
+				irc_send_num( irc, 491, ":Password added to IM account "
+				              "%s(%s)", a->prpl->name, a->user );
+			}
+	}
+	else if( irc->status & OPER_HACK_IDENTIFY )
+	{
+		char *send_cmd[] = { "identify", password, NULL };
+		irc_send_num( irc, 491, ":Trying to identify" );
+		root_command( irc, send_cmd );
+	}
+	else if( irc->status & OPER_HACK_REGISTER )
+	{
+		char *send_cmd[] = { "register", password, NULL };
+		irc_send_num( irc, 491, ":Trying to identify" );
+		root_command( irc, send_cmd );
+	}
+	
+	irc->status &= ~OPER_HACK_ANY;
+	g_free( password );
 }
 
@@ -756,5 +783,5 @@
 		}
 	
-	if( irc->status >= USTATUS_LOGGED_IN )
+	if( irc->status & USTATUS_LOGGED_IN )
 		irc_send_num( irc, 421, "%s :Unknown command", cmd[0] );
 }
Index: root_commands.c
===================================================================
--- root_commands.c	(revision 00fd005cd04ce4f68ff2d72de75a313868564f54)
+++ root_commands.c	(revision 060d0661ff8c1465f394c307d0f4c2a22964c6b2)
@@ -114,5 +114,8 @@
 	}
 	
-	if( strncmp( cmd[1], "-no", 3 ) == 0 )
+	if( cmd[1] == NULL )
+	{
+	}
+	else if( strncmp( cmd[1], "-no", 3 ) == 0 )
 	{
 		load = FALSE;
@@ -135,5 +138,7 @@
 	if( password == NULL )
 	{
-		MIN_ARGS( 2 );
+		irc_usermsg( irc, "About to identify, use /OPER to enter the password" );
+		irc->status |= OPER_HACK_IDENTIFY;
+		return;
 	}
 	
@@ -211,4 +216,11 @@
 	{
 		irc_usermsg( irc, "This server does not allow registering new accounts" );
+		return;
+	}
+	
+	if( cmd[1] == NULL )
+	{
+		irc_usermsg( irc, "About to register, use /OPER to enter the password" );
+		irc->status |= OPER_HACK_REGISTER;
 		return;
 	}
@@ -1362,10 +1374,10 @@
 	{ "group",          1, cmd_group,          0 },
 	{ "help",           0, cmd_help,           0 }, 
-	{ "identify",       1, cmd_identify,       0 },
+	{ "identify",       0, cmd_identify,       0 },
 	{ "info",           1, cmd_info,           0 },
 	{ "nick",           1, cmd_nick,           0 },
 	{ "no",             0, cmd_yesno,          0 },
 	{ "qlist",          0, cmd_qlist,          0 },
-	{ "register",       1, cmd_register,       0 },
+	{ "register",       0, cmd_register,       0 },
 	{ "remove",         1, cmd_remove,         0 },
 	{ "rename",         2, cmd_rename,         0 },
