Revision 39128f8c bin/mn

View differences:

bin/mn
19 19
from mininet.clean import cleanup
20 20
from mininet.cli import CLI
21 21
from mininet.log import lg, LEVELS, info, warn
22
from mininet.net import Mininet, MininetWithControlNet
22
from mininet.net import Mininet, MininetWithControlNet, VERSION
23 23
from mininet.node import ( Host, CPULimitedHost, Controller, OVSController,
24 24
                           NOX, RemoteController, UserSwitch, OVSKernelSwitch,
25 25
                           OVSLegacyKernelSwitch )
......
87 87
                    help = helpStr )
88 88

  
89 89

  
90
def version( *_args ):
91
    "Print Mininet version and exit"
92
    print "mn (Mininet %s)" % VERSION
93
    exit()
94

  
90 95
class MininetRunner( object ):
91 96
    "Build, setup, and run Mininet."
92 97

  
......
179 184
        opts.add_option( '--pin', action='store_true',
180 185
                         default=False, help="pin hosts to CPU cores "
181 186
                         "(requires --host cfs or --host rt)" )
182
        def fakeversion( *args ):
183
            "Fake version for help2man"
184
            print "mn (development version)"
185
        opts.add_option( '--version', action='callback', callback=fakeversion )
187
        opts.add_option( '--version', action='callback', callback=version )
186 188

  
187 189
        self.options, self.args = opts.parse_args()
188 190

  

Also available in: Unified diff