def get_taurus_parser(parser=None):
    """ Returns a :class:`optparse.OptionParser` initialized with a
    :class:`optparse.OptionGroup` containning some taurus options.
    If a parser is given as parameter then it uses this parser instead of
    creating a new one.

    :param parser: an option parser or None (default) to create a new parser
    :type parser: :class:`optparse.OptionParser`
    :return: an option parser or the given parser if it is not None
    :rtype: :class:`optparse.OptionParser`"""
    import optparse
    if parser is None:
        parser = optparse.OptionParser()
    g = parser.get_option_group('--taurus-log-level')
    if g is None:
        group = optparse.OptionGroup(parser, 'Taurus Options',
            'Basic options present in any taurus application')
        help_tauruslog = (
            'taurus log level. Allowed values are (case insensitive): critical, error, warning/warn, info, debug, trace'
            )
        help_tangohost = (
            'Tango host name (either HOST:PORT or a Taurus URI, e.g. tango://foo:1234)'
            )
        help_tauruspolling = 'taurus global polling period in milliseconds'
        help_taurusserial = (
            'taurus serialization mode. Allowed values are (case insensitive): serial, concurrent (default)'
            )
        help_rcport = 'enables remote debugging using the given port'
        help_formatter = 'Override the default formatter'
        group.add_option('--taurus-log-level', dest='taurus_log_level',
            metavar='LEVEL', help=help_tauruslog, type='str', default='info')
        group.add_option('--taurus-polling-period', dest=
            'taurus_polling_period', metavar='MILLISEC', help=
            help_tauruspolling, type='int', default=None)
        group.add_option('--taurus-serialization-mode', dest=
            'taurus_serialization_mode', metavar='SERIAL', help=
            help_taurusserial, type='str', default='Concurrent')
        group.add_option('--tango-host', dest='tango_host', metavar=
            'TANGO_HOST', help=help_tangohost, type='str', default=None)
        group.add_option('--remote-console-port', dest=
            'remote_console_port', metavar='PORT', help=help_rcport, type=
            'int', default=None)
        group.add_option('--default-formatter', dest='default_formatter',
            metavar='FORMATTER', help=help_formatter, type='str', default=None)
        parser.add_option_group(group)
    return parser
