default(): add CR to error(); also clean up docstring

This commit is contained in:
Bob Lantz
2017-02-08 16:30:36 -08:00
parent dfb2594793
commit 0b5d24148b
+5 -4
View File
@@ -399,15 +399,16 @@ class CLI( Cmd ):
def default( self, line ): def default( self, line ):
"""Called on an input line when the command prefix is not recognized. """Called on an input line when the command prefix is not recognized.
Overridden to run shell commands when a node is the first CLI argument. Overridden to run shell commands when a node is the first
Past the first CLI argument, node names are automatically replaced with CLI argument. Past the first CLI argument, node names are
corresponding IP addrs.""" automatically replaced with corresponding IP addrs."""
first, args, line = self.parseline( line ) first, args, line = self.parseline( line )
if first in self.mn: if first in self.mn:
if not args: if not args:
error( "*** Enter a command for node: %s <cmd>" % first ) error( '*** Please enter a command for node: %s <cmd>\n'
% first )
return return
node = self.mn[ first ] node = self.mn[ first ]
rest = args.split( ' ' ) rest = args.split( ' ' )