This is an archive of the discontinued LLVM Phabricator instance.

Change the LNT command line parser to click
ClosedPublic

Authored by leandron on May 25 2017, 2:30 AM.

Details

Summary

This patch changes the default command line argument parser on LNT from optparse to click.

Related bugzilla bug: https://bugs.llvm.org/show_bug.cgi?id=32789

Diff Detail

Event Timeline

leandron created this revision.May 25 2017, 2:30 AM

@cmatthews: I first tried using argparse, but ran into issues, as explained below. So, instead I decided to try using click to fix PR32789. Does this patch look like what you had in mind?

cmatthews requested changes to this revision.Jun 23 2017, 1:27 PM

This looks like a great idea to me. I am very happy to modernize to click. Only nit: code and doc comments should always use full sentences. Please fix comment, otherwise looks good!

lnt/tests/builtintest.py
25

The name _fatal would match more the error logging in the rest of LNT. We use error for non-exiting, and fatal for exit on the spot issues.

This revision now requires changes to proceed.Jun 23 2017, 1:27 PM
leandron updated this revision to Diff 104206.Jun 27 2017, 10:25 AM
leandron edited edge metadata.
leandron marked an inline comment as done.
  • Updated the svn revision, solved a few conflicts (namely main.py).
  • Renamed _error to _fatal
  • Adjusted a docstring (action_runtest) that was changed by mistake

@cmatthews I've found one docstring that was incorrectly changed. Please let me know if you were talking about a different one when you said "Please fix comment" (or even more than one).

cmatthews accepted this revision.Jun 27 2017, 10:35 AM

Looks good. Thanks!

This revision is now accepted and ready to land.Jun 27 2017, 10:35 AM
This revision was automatically updated to reflect the committed changes.
lnt/tests/test_suite.py