Revision cac98f5f mininet/cli.py

View differences:

mininet/cli.py
137 137
        dumpNodeConnections( self.mn.values() )
138 138

  
139 139
    def do_sh( self, line ):
140
        "Run an external shell command"
140
        """Run an external shell command
141
           Usage: sh [cmd args]"""
141 142
        call( line, shell=True )
142 143

  
143 144
    # do_py() and do_px() need to catch any exception during eval()/exec()
......
187 188
        self.mn.pingPairFull()
188 189

  
189 190
    def do_iperf( self, line ):
190
        "Simple iperf TCP test between two (optionally specified) hosts."
191
        """Simple iperf TCP test between two (optionally specified) hosts.
192
           Usage: iperf node1 node2"""
191 193
        args = line.split()
192 194
        if not args:
193 195
            self.mn.iperf()
......
206 208
            error( 'invalid number of args: iperf src dst\n' )
207 209

  
208 210
    def do_iperfudp( self, line ):
209
        "Simple iperf UDP test between two (optionally specified) hosts."
211
        """Simple iperf UDP test between two (optionally specified) hosts.
212
           Usage: iperfudp bw node1 node2"""
210 213
        args = line.split()
211 214
        if not args:
212 215
            self.mn.iperf( l4Type='UDP' )
......
238 241
            output( '%s\n' % repr( node ) )
239 242

  
240 243
    def do_link( self, line ):
241
        "Bring link(s) between two nodes up or down."
244
        """Bring link(s) between two nodes up or down.
245
           Usage: link node1 node2 [up/down]"""
242 246
        args = line.split()
243 247
        if len(args) != 3:
244 248
            error( 'invalid number of args: link end1 end2 [up down]\n' )
......
248 252
            self.mn.configLinkStatus( *args )
249 253

  
250 254
    def do_xterm( self, line, term='xterm' ):
251
        "Spawn xterm(s) for the given node(s)."
255
        """Spawn xterm(s) for the given node(s).
256
           Usage: xterm node1 node2 ..."""
252 257
        args = line.split()
253 258
        if not args:
254 259
            error( 'usage: %s node1 node2 ...\n' % term )
......
262 267

  
263 268
    def do_x( self, line ):
264 269
        """Create an X11 tunnel to the given node,
265
           optionally starting a client."""
270
           optionally starting a client.
271
           Usage: x node [cmd args]"""
266 272
        args = line.split()
267 273
        if not args:
268 274
            error( 'usage: x node [cmd args]...\n' )
......
272 278
            self.mn.terms += runX11( node, cmd )
273 279

  
274 280
    def do_gterm( self, line ):
275
        "Spawn gnome-terminal(s) for the given node(s)."
281
        """Spawn gnome-terminal(s) for the given node(s).
282
           Usage: gterm node1 node2 ..."""
276 283
        self.do_xterm( line, term='gterm' )
277 284

  
278 285
    def do_exit( self, _line ):
......
293 300
        return isatty( self.stdin.fileno() )
294 301

  
295 302
    def do_noecho( self, line ):
296
        "Run an interactive command with echoing turned off."
303
        """Run an interactive command with echoing turned off.
304
           Usage: noecho [cmd args]"""
297 305
        if self.isatty():
298 306
            quietRun( 'stty -echo' )
299 307
        self.default( line )
......
301 309
            quietRun( 'stty echo' )
302 310

  
303 311
    def do_source( self, line ):
304
        "Read commands from an input file."
312
        """Read commands from an input file.
313
           Usage: source <file>"""
305 314
        args = line.split()
306 315
        if len(args) != 1:
307 316
            error( 'usage: source <file>\n' )
......
320 329
        self.inputFile = None
321 330

  
322 331
    def do_dpctl( self, line ):
323
        "Run dpctl (or ovs-ofctl) command on all switches."
332
        """Run dpctl (or ovs-ofctl) command on all switches.
333
           Usage: dpctl command [arg1] [arg2] ..."""
324 334
        args = line.split()
325 335
        if len(args) < 1:
326 336
            error( 'usage: dpctl command [arg1] [arg2] ...\n' )

Also available in: Unified diff