diff: address comments from review

* OSError -> FileNotFoundError
* Make `a_ref` optional
* Use absolute imports for unrelated packages
* Relpath: `str(output.path_info)` -> `str(output)`
* `a_ref` defaults to `HEAD` at the signature and parser level
This commit is contained in:
Mr. Outis
2020-01-24 10:05:44 -06:00
parent 198bf55aaf
commit ebd5a5a7f3
2 changed files with 10 additions and 10 deletions
+5 -2
View File
@@ -32,13 +32,16 @@ def add_parser(subparsers, parent_parser):
formatter_class=argparse.RawDescriptionHelpFormatter,
)
diff_parser.add_argument(
"a_ref", help="Git reference from which diff calculates"
"a_ref",
help="Git reference from which diff calculates (defaults to HEAD)",
nargs="?",
default="HEAD"
)
diff_parser.add_argument(
"b_ref",
help=(
"Git reference until which diff calculates, if omitted "
"diff shows the difference between current HEAD and a_ref"
"diff shows the difference between the working tree and a_ref"
),
nargs="?",
)