Revision 68f97b74 mininet/cli.py

View differences:

mininet/cli.py
163 163
        else:
164 164
            self.mn.configLinkStatus( *args )
165 165

  
166
    def do_term( self, args ):
167
        "Spawn terminal for the given node."
166
    def do_xterm( self, args, term='xterm' ):
167
        "Spawn xterm(s) for the given node(s)."
168 168
        args = args.split()
169 169
        if not args:
170
            error( 'please specify node list: term [type] node1 node2 ...\n' )
170
            info( 'usage: %s node1 node2 ...\n' % term )
171 171
        else:
172
            if args[ 0 ] in [ 'xterm', 'gnome' ]:
173
                term = args[ 0 ]
174
                args = args[ 1: ]
175
            else:
176
                term = 'xterm'
177 172
            for arg in args:
178 173
                if arg not in self.nodemap:
179
                    error( 'arg not in network: %s\n' % arg )
174
                    error( "node '%s' not in network\n" % arg )
180 175
                else:
181 176
                    node = self.nodemap[ arg ]
182 177
                    self.mn.terms += makeTerms( [ node ], term = term )
183 178

  
179
    def do_gterm( self, args ):
180
        "Spawn gnome-terminal(s) for the given node(s)."
181
        self.do_xterm( args, term='gterm' )
182

  
184 183
    def do_exit( self, args ):
185 184
        "Exit"
186 185
        return 'exited by user command'

Also available in: Unified diff