Skip to content

Tree hash imports argparse, not to use it #179

Open
@katesalazar

Description

@katesalazar

(and it doesn't handle arguments idiomatically)

Imports argparse:

Not to use it:

if len(sys.argv)>1:

But if I call treehash512.py -h, (almost idiomatic Python?), it'll pass it down (needlessly) to Git ls-tree.

print(tree_sha512sum(commit))

I propose you:

  • remove the argparse import, or
  • use argparse idiomatically, and
    • check argument validity before calling Git

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions