()
return parser
Builds and returns the argument parser.
Builds and returns the argument parser.
Builds and returns the argument parser .
def _get_argparser():
    """Builds and returns the argument parser."""
    parser = argparse.ArgumentParser(
        formatter_class=argparse.RawDescriptionHelpFormatter,
        usage='%(prog)s [--help] [--smallmap] <in-filename> [<out-filename>]',
        description=textwrap.dedent('''
        Turns a PICO-8 cart upside down.

          p8upsidedown mycart.p8.png mycart_upsidedown.p8
        '''))
    parser.add_argument(
        '--smallmap', action='store_true',
        help='assume the cart\'s shared gfx/map region is used '
        'as gfx; the default is to assume it is used as map')
    parser.add_argument(
        '--flipbuttons', action='store_true',
        help='switch buttons left and right, up and down')
    parser.add_argument(
        '--flipsounds', action='store_true',
        help='reverse sound effect patterns')
    parser.add_argument(
        'infile', type=str,
        help='the cart to turn upside down; can be .p8 '
        'or .p8.png')
    parser.add_argument(
        'outfile', type=str, nargs='?',
        help='the filename of the new cart; must end in .p8; '
        'if not specified, adds _upsidedown.p8 to the original '
        'base name')
    return parser
def _get_argparser ( ) : parser = argparse . ArgumentParser ( formatter_class = argparse . RawDescriptionHelpFormatter , usage = '%(prog)s [--help] [--smallmap] <in-filename> [<out-filename>]' , description = textwrap . dedent ( '''
        Turns a PICO-8 cart upside down.

          p8upsidedown mycart.p8.png mycart_upsidedown.p8
        ''' ) ) parser . add_argument ( '--smallmap' , action = 'store_true' , help = 'assume the cart\'s shared gfx/map region is used ' 'as gfx; the default is to assume it is used as map' ) parser . add_argument ( '--flipbuttons' , action = 'store_true' , help = 'switch buttons left and right, up and down' ) parser . add_argument ( '--flipsounds' , action = 'store_true' , help = 'reverse sound effect patterns' ) parser . add_argument ( 'infile' , type = str , help = 'the cart to turn upside down; can be .p8 ' 'or .p8.png' ) parser . add_argument ( 'outfile' , type = str , nargs = '?' , help = 'the filename of the new cart; must end in .p8; ' 'if not specified, adds _upsidedown.p8 to the original ' 'base name' ) return parser