def METHOD_NAME(parent):
    """Create parser for 'hash' subcommand."""
    parser = parent.add_parser("hash", help="calculate hash digest")
    parser.set_defaults(func=hash_command)
    parser.add_argument(
        "input", nargs="?", type=argparse.FileType("r"), default=sys.stdin
    )
    parser.add_argument(
        "-m",
        "--method",
        choices=[h.name for h in Hash],
        default="SHA1",
        help="hashing method (default: %(default)s)",
    )