Add support for generating man page from mn --help.
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
MININET = mininet/*.py
|
||||
TEST = mininet/test/*.py
|
||||
EXAMPLES = examples/*.py
|
||||
BIN = bin/mn
|
||||
MN = bin/mn
|
||||
BIN = $(MN)
|
||||
PYSRC = $(MININET) $(TEST) $(EXAMPLES) $(BIN)
|
||||
MNEXEC = mnexec
|
||||
P8IGN = E251,E201,E302,E202
|
||||
@@ -34,6 +35,12 @@ develop: $(MNEXEC)
|
||||
install $(MNEXEC) /usr/local/bin/
|
||||
python setup.py develop
|
||||
|
||||
doc:
|
||||
man: mn.1
|
||||
|
||||
mn.1: $(MN)
|
||||
help2man -N -n "create a Mininet network." --no-discard-stderr $(MN) \
|
||||
> mn.1
|
||||
|
||||
doc: man
|
||||
doxygen doxygen.cfg
|
||||
|
||||
|
||||
@@ -134,7 +134,11 @@ class MininetRunner( object ):
|
||||
else:
|
||||
raise Exception( 'Custom file name not found' )
|
||||
|
||||
opts = OptionParser()
|
||||
desc = ( "The %prog utility creates Mininet network from the\n"
|
||||
"command line. It can create parametrized topologies,\n"
|
||||
"invoke the Mininet CLI, and run tests." )
|
||||
|
||||
opts = OptionParser( description=desc )
|
||||
addDictOption( opts, SWITCHES, SWITCHDEF, 'switch' )
|
||||
addDictOption( opts, HOSTS, HOSTDEF, 'host' )
|
||||
addDictOption( opts, CONTROLLERS, CONTROLLERDEF, 'controller' )
|
||||
@@ -175,6 +179,10 @@ class MininetRunner( object ):
|
||||
opts.add_option( '--pin', action='store_true',
|
||||
default=False, help="pin hosts to CPU cores "
|
||||
"(requires --host cfs or --host rt)" )
|
||||
def fakeversion( *args ):
|
||||
"Fake version for help2man"
|
||||
print "mn (development version)"
|
||||
opts.add_option( '--version', action='callback', callback=fakeversion )
|
||||
|
||||
self.options, self.args = opts.parse_args()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user