#NEWLINE# def parse_args( args , config ) : #NEWLINE# #INDENT# parser = argparse . ArgumentParser ( ) #NEWLINE# subparsers = parser . add_subparsers ( help = 'sub-command help' ) #NEWLINE# list_parser = subparsers . add_parser ( 'list' , help = 'List all Launch Configs' ) #NEWLINE# list_parser . set_defaults ( mode = 'list' ) #NEWLINE# launch_parser = subparsers . add_parser ( 'launch' , help = 'Launch a Launch Config' ) #NEWLINE# launch_parser . set_defaults ( mode = 'launch' ) #NEWLINE# launch_parser . add_argument ( 'launches' , action = 'append' , default = [ parser . confname for lc in config . launches if lc . selected ] , metavar = 'NAME' , nargs = '+' , help = 'Launch configuration to use (can be repeated)' ) #NEWLINE# launch_parser . add_argument ( '--save-passwords' , default = config . settings [ 'remember-passwords' ] , action = 'store_true' , help = 'Save passwords for all alts (encrypted with one master password)' ) #NEWLINE# launch_parser . add_argument ( '-d' , '--dry' , default = False , action = 'store_true' , help = 'Dry-run (for MLP developers)' ) #NEWLINE# config_parser = subparsers . add_parser ( 'config' , help = 'Configure a Launch Config' ) #NEWLINE# config_parser . set_defaults ( mode = 'config' ) #NEWLINE# config_parser . add_argument ( 'launch' , default = '(Defaults)' , metavar = 'NAME' , nargs = '?' , help = 'Launch configuration to use' ) #NEWLINE# config_parser . add_argument ( '--confname' , default = None , metavar = 'NAME' , help = 'Rename the selected launch config to NAME' ) #NEWLINE# config_parser . add_argument ( '--username' , default = None , metavar = 'NAME' , help = 'Set username for this launch config' ) #NEWLINE# config_parser . add_argument ( '--gamepath' , default = None , metavar = 'DIR' , help = 'Point to the location of the Eve install folder' ) #NEWLINE# config_parser . add_argument ( '--serverid' , default = None , help = 'Which server to connect to (tranquility (default) or singularity)' ) #NEWLINE# config_parser . add_argument ( '--selected' , default = None , help = 'Whether or not this should be one of the default launches' ) #NEWLINE# config_parser . add_argument ( '--winecmd' , default = None , help = "Wine command (eg. 'wine explorer')" ) #NEWLINE# config_parser . add_argument ( '--wineflags' , default = None , help = "Wine flags (eg. '/desktop=EVE,1920x1080')" ) #NEWLINE# delete_parser = subparsers . add_parser ( 'delete' , help = 'Delete a Launch Config' ) #NEWLINE# delete_parser . set_defaults ( mode = 'delete' ) #NEWLINE# delete_parser . add_argument ( 'launch' , metavar = 'NAME' , help = 'Launch configuration to use' ) #NEWLINE# add_parser = subparsers . add_parser ( 'add' , help = 'Add a Launch Config' ) #NEWLINE# add_parser . set_defaults ( mode = 'add' ) #NEWLINE# add_parser . add_argument ( 'launch' , metavar = 'NAME' , help = 'Launch configuration to use' ) #NEWLINE# parser . add_argument ( '-v' , '--verbose' , action = 'count' , default = 0 , help = "Be more verbose (use more -v's for more verbosity)" ) #NEWLINE# args = parser . parse_args ( args ) #NEWLINE# logging . basicConfig ( level = logging . DEBUG , format = '%(asctime)19.19s %(levelname)4.4s %(message)s' ) #NEWLINE# module_log = logging . getLogger ( 'eve_mlp' ) #NEWLINE# module_log . setLevel ( ( logging . WARNING - ( args . verbose * 10 ) ) ) #NEWLINE# return args