def get_default_parser(usage='%prog [options] <start|stop|status>'):
 parser = OptionParser(usage=usage)
 parser.add_option('--debug', action='store_true', help='Run in the foreground, log to stdout')
 parser.add_option('--syslog', action='store_true', help='Write logs to syslog')
 parser.add_option('--nodaemon', action='store_true', help='Run in the foreground')
 parser.add_option('--profile', help='Record performance profile data to the given file')
 parser.add_option('--profiler', help='Specify the profiler to use')
 parser.add_option('--pidfile', default=None, help='Write pid to the given file')
 parser.add_option('--umask', default=None, help='Use the given umask when creating files')
 parser.add_option('--config', default=None, help='Use the given config file')
 parser.add_option('--whitelist', default=None, help='Use the given whitelist file')
 parser.add_option('--blacklist', default=None, help='Use the given blacklist file')
 parser.add_option('--logdir', default=None, help='Write logs in the given directory')
 parser.add_option('--instance', default='a', help='Manage a specific carbon instance')
 return parser

def get_default_parser ( usage = '%prog [options] <start|stop|status>' ) : parser = OptionParser ( usage = usage ) parser . add_option ( '--debug' , action = 'store_true' , help = 'Run in the foreground, log to stdout' ) parser . add_option ( '--syslog' , action = 'store_true' , help = 'Write logs to syslog' ) parser . add_option ( '--nodaemon' , action = 'store_true' , help = 'Run in the foreground' ) parser . add_option ( '--profile' , help = 'Record performance profile data to the given file' ) parser . add_option ( '--profiler' , help = 'Specify the profiler to use' ) parser . add_option ( '--pidfile' , default = None , help = 'Write pid to the given file' ) parser . add_option ( '--umask' , default = None , help = 'Use the given umask when creating files' ) parser . add_option ( '--config' , default = None , help = 'Use the given config file' ) parser . add_option ( '--whitelist' , default = None , help = 'Use the given whitelist file' ) parser . add_option ( '--blacklist' , default = None , help = 'Use the given blacklist file' ) parser . add_option ( '--logdir' , default = None , help = 'Write logs in the given directory' ) parser . add_option ( '--instance' , default = 'a' , help = 'Manage a specific carbon instance' ) return parser
create a parser for command line options .