New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add --reporter parameter #10

Merged
merged 7 commits into from Apr 16, 2018
Next

Add reporters option to main

  • Loading branch information...
sunshinejr committed Feb 18, 2018
commit 268d8861febd2fc0fc36cb471a2ccf3d5204babd
Copy path View file
@@ -31,7 +31,11 @@ def main():
)
parser.add_argument("-v", "--version", action="version",
version=__version__)
parser.parse_args()
parser.add_argument("--reporter", choices=("raw", "json"),
default="raw",
help="custom reporter to use (optional)")

This comment has been minimized.

@ikonst

ikonst Apr 16, 2018

Contributor

argparse arguments are always optional, so perhaps we can omit the "(optional)". The default value "raw" would be indicated as part of the help text anyway.

args = parser.parse_args()
reporter = args.reporter

This comment has been minimized.

@ikonst

ikonst Apr 16, 2018

Contributor

After you assign this variable, you're never changing it, so perhaps directly using args.reporter will make it clearer that it's coming from the args.

try:
config = Config()
ProTip! Use n and p to navigate between commits in a pull request.