emsm.core.argparse_¶
This module contains the ArgumentParser class which wraps a
Python argparse.ArgumentParser for the EMSM.
-
class
emsm.core.argparse_.LongHelpAction(option_strings, description=None, dest='==SUPPRESS==', default='==SUPPRESS==')[source]¶ Bases:
argparse.ActionPrints the description using less (if available) and exists.
-
class
emsm.core.argparse_.ArgumentParser(app)[source]¶ Bases:
objectWraps an
argparse.ArgumentParserinstance.This class handles the root EMSM argument parser. The root parser only has a few global EMSM commands like
-w,-s. Each plugin has its own subparser:$ foo@bar: minecraft [emsm args] (plugin_name) [plugin args]
Example:
# Call the *worlds* plugin with the world *foo* as target. $ foo@bar: minecraft -w foo worlds --status-
argparser()[source]¶ Returns the wrapped
argparse.ArgumentParserinstance.
-
args(cache=True)[source]¶ Parses (if not yet done) the command line arguments and returns a namespace object that contains the result.
Parameters: cache (bool) – If True, and the arguments have already been parsed, the result of the previous parse is returned.See also
-
setup()[source]¶ Adds the global EMSM arguments to the root argument parser.
This method has to be called, when the
WorldManagerandServerManagerhave been loaded, since we require the names of the available worlds and server.
-