Create command subparsers.

    Parameters
    ----------
    parent : `argparse.ArgumentParser`
        Command parser.

def create_arg_parser(parent):
    """Create command subparsers.

    Parameters
    ----------
    parent : `argparse.ArgumentParser`
        Command parser.
    """

    arg1 = parent.add_subparsers(dest='command')

    arg2 = arg1.add_parser('create')
    arg2.add_argument('-P', '--progress',
                      action='store_true',
                      help='show progress bar')
    arg2.add_argument('-s', '--settings',
                      type=FileType('r'), default=None,
                      help='settings json file')
    arg2.add_argument('-o', '--output',
                      default=None,
                      help='output file (default: stdout)')
    arg2.add_argument('input', nargs='*',
                      help='input file')

    arg2 = arg1.add_parser('update')
    arg2.add_argument('-P', '--progress',
                      action='store_true',
                      help='show progress bar')
    arg2.add_argument('-s', '--settings',
                      type=FileType('r'), default=None,
                      help='settings json file')
    arg2.add_argument('-o', '--output',
                      default=None,
                      help='output file (default: rewrite state file)')
    arg2.add_argument('state',
                      help='state file')
    arg2.add_argument('input', nargs='*',
                      help='input file')

    arg2 = arg1.add_parser('settings')
    arg2.add_argument('state',
                      help='state file')

    arg2 = arg1.add_parser('generate')
    arg2.add_argument('-P', '--progress',
                      action='store_true',
                      help='show progress bar')
    arg2.add_argument('-s', '--settings',
                      type=FileType('r'), default=None,
                      help='settings json file')
    arg2.add_argument('-ss', '--state-size',
                      type=int, nargs='+', default=None,
                      help='generator state sizes')
    arg2.add_argument('-S', '--size', metavar=('WIDTH', 'HEIGHT'),
                      type=int, nargs=2, default=None,
                      help='image size (default: <scanner.resize>)')
    arg2.add_argument('-l', '--level',
                      type=int, default=None,
                      help='image levels (default: <scanner.levels>)')
    arg2.add_argument('-c', '--count',
                      type=int, default=1,
                      help='generated image count (default: %(default)s)')
    arg2.add_argument('state',
                      help='state file')
    arg2.add_argument('output',
                      help='output file name format string')

    arg2 = arg1.add_parser('filter')
    arg2.add_argument('-P', '--progress',
                      action='store_true',
                      help='show progress bar')
    arg2.add_argument('-t', '--type',
                      choices=('json', 'sqlite'), default='json',
                      help='generator type (default: %(default)s)')
    arg2.add_argument('-s', '--settings',
                      type=FileType('r'), default=None,
                      help='settings json file')
    arg2.add_argument('-S', '--state',
                      default=None,
                      help='state file')
    arg2.add_argument('-ss', '--state-size',
                      type=int, nargs='+', default=None,
                      help='generator state sizes')
    arg2.add_argument('-l', '--level',
                      type=int, default=1,
                      help='filter start level (default: %(default)s)')
    arg2.add_argument('-c', '--count',
                      type=int, default=1,
                      help='generated image count (default: %(default)s)')
    arg2.add_argument('input',
                      help='input image')
    arg2.add_argument('output',
                      help='output file name format string')