Skip to content
Snippets Groups Projects
Commit 68f97b74 authored by Bob Lantz's avatar Bob Lantz
Browse files

Added explicit xterm and gterm commands.

This is not as generic as having a single 'term' command, but
it's a lot more convenient to use.
parent 9ab2cba8
No related branches found
No related tags found
No related merge requests found
......@@ -163,24 +163,23 @@ def do_link( self, args ):
else:
self.mn.configLinkStatus( *args )
def do_term( self, args ):
"Spawn terminal for the given node."
def do_xterm( self, args, term='xterm' ):
"Spawn xterm(s) for the given node(s)."
args = args.split()
if not args:
error( 'please specify node list: term [type] node1 node2 ...\n' )
info( 'usage: %s node1 node2 ...\n' % term )
else:
if args[ 0 ] in [ 'xterm', 'gnome' ]:
term = args[ 0 ]
args = args[ 1: ]
else:
term = 'xterm'
for arg in args:
if arg not in self.nodemap:
error( 'arg not in network: %s\n' % arg )
error( "node '%s' not in network\n" % arg )
else:
node = self.nodemap[ arg ]
self.mn.terms += makeTerms( [ node ], term = term )
def do_gterm( self, args ):
"Spawn gnome-terminal(s) for the given node(s)."
self.do_xterm( args, term='gterm' )
def do_exit( self, args ):
"Exit"
return 'exited by user command'
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment