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 (default: stdin)')

    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 (default: stdin)')

    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('-nf', '--no-format',
                      dest='format',
                      action='store_false',
                      help='do not format text')
    arg2.add_argument('-s', '--settings',
                      type=FileType('r'), default=None,
                      help='settings json file')
    arg2.add_argument('-ss', '--state-size',
                      type=int, default=None,
                      help='generator state size')
    arg2.add_argument('-S', '--start',
                      default=None,
                      help='text start')
    arg2.add_argument('-E', '--end',
                      default=None,
                      help='text end')
    arg2.add_argument('-R', '--reply',
                      default=None,
                      help='reply to text')
    arg2.add_argument('-w', '--words',
                      type=int, default=256,
                      help='max text size (default: %(default)s)')
    arg2.add_argument('-c', '--count',
                      type=int, default=1,
                      help='number of generated texts (default: %(default)s)')
    arg2.add_argument('-o', '--output',
                      type=FileType('w'), default=None,
                      help='output file (default: stdout)')
    arg2.add_argument('state',
                      help='state file')

    arg2.set_defaults(format=True)