def _htid2rsync_argparser():
    """
    Return arg parser. Separated from htid2rsync_cmd For easier testing.
    """
    import argparse
    import sys
    parser = argparse.ArgumentParser(description=
        "Convert a HathiTrust ID to a stubbytree path for Rsyncing that id's Extracted Features dataset file. This does not check if the file exists."
        )
    parser.add_argument('id', type=str, nargs='*', help=
        'A HathiTrust id or multiple ids to convert.')
    parser.add_argument('--from-file', '-f', nargs='?', type=argparse.
        FileType('r'), const='-', help=
        'Read volume ids from an external file. Use as flag or supply - to read from stdin.'
        )
    parser.add_argument('--oldstyle', '-s', action='store_true', help=
        'Whether to use the pre-EF2.0 file structure (pairtree) rather than the current stubbytree.'
        )
    parser.add_argument('--outfile', '-o', nargs='?', type=argparse.
        FileType('w'), default=sys.stdout, help=
        'File to save to. By default it writes to standard out.')
    return parser
