'Given the command-line arguments, this creates a parser appropriate
to that command, and runs it.'

def execute(self):

    default_locale = os.environ.get(u'LANG', u'en_US').split(u'.')[0]
    if (default_locale not in AVAILABLE_LOCALES):
        default_locale = DEFAULT_LOCALE
    epilog = u'supported    locales:\n\n        {0}\n\n        faker    can    take    a    locale    as    an    argument,    to    return    localized    data.    If    no\n        localized    provider    is    found,    the    factory    falls    back    to    the    default    en_US\n        locale.\n\nexamples:\n\n        $    faker    address\n        968    Bahringer    Garden    Apt.    722\n        Kristinaland,    NJ    09890\n\n        $    faker    -l    de_DE    address\n        Samira-Niemeier-Allee    56\n        94812    Biedenkopf\n\n        $    faker    profile    ssn,birthdate\n        {{\'ssn\':    u\'628-10-1085\',    \'birthdate\':    \'2008-03-29\'}}\n\n        $    faker    -r=3    -s=";"    name\n        Willam    Kertzmann;\n        Josiah    Maggio;\n        Gayla    Schmitt;\n\n'.format(u',    '.join(sorted(AVAILABLE_LOCALES)))
    formatter_class = argparse.RawDescriptionHelpFormatter
    parser = argparse.ArgumentParser(prog=self.prog_name, description=u'{0}    version    {1}'.format(self.prog_name, VERSION), epilog=epilog, formatter_class=formatter_class)
    parser.add_argument(u'--version', action=u'version', version=u'%(prog)s    {0}'.format(VERSION))
    parser.add_argument(u'-o', metavar=u'output', type=argparse.FileType(u'w'), default=sys.stdout, help=u'redirect    output    to    a    file')
    parser.add_argument(u'-l', u'--lang', choices=AVAILABLE_LOCALES, default=default_locale, metavar=u'LOCALE', help=u'specify    the    language    for    a    localized    provider    (e.g.    de_DE)')
    parser.add_argument(u'-r', u'--repeat', default=1, type=int, help=u'generate    the    specified    number    of    outputs')
    parser.add_argument(u'-s', u'--sep', default=u'\n', help=u'use    the    specified    separator    after    each    output')
    parser.add_argument(u'-i', u'--include', default=META_PROVIDERS_MODULES, nargs=u'*', help=u'list    of    additional    custom    providers    to    user,    given    as    the    import    path    of    the    module    containing    your    Provider    class    (not    the    provider    class    itself)')
    parser.add_argument(u'fake', action=u'store', nargs=u'?', help=u'name    of    the    fake    to    generate    output    for    (e.g.    profile)')
    parser.add_argument(u'fake_args', metavar=u'fake    argument', action=u'store', nargs=u'*', help=u'optional    arguments    to    pass    to    the    fake    (e.g.    the    profile    fake    takes    an    optional    list    of    comma    separated    field    names    as    the    first    argument)')
    arguments = parser.parse_args(self.argv[1:])
    for i in range(arguments.repeat):
        print_doc(arguments.fake, arguments.fake_args, lang=arguments.lang, output=arguments.o, includes=arguments.include)
        print(arguments.sep, file=arguments.o)
        if (not arguments.fake):
            break
