Skip to content

Commit

Permalink
utils/compare.py: Add a main() function
Browse files Browse the repository at this point in the history
This prevents all the variables being declared as globals. I noticed this
due to a typo while working on D121908.
  • Loading branch information
arichardson committed Apr 20, 2022
1 parent 16b7d7f commit bb77bd4
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion utils/compare.py
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ def float_format(x):
print(out)
print(d.describe())

if __name__ == "__main__":
def main():
parser = argparse.ArgumentParser(prog='compare.py')
parser.add_argument('-a', '--all', action='store_true')
parser.add_argument('-f', '--full', action='store_true')
Expand Down Expand Up @@ -390,3 +390,7 @@ def float_format(x):
shorten_names = not config.full
limit_output = (not config.all) and (not config.full)
print_result(data, limit_output, shorten_names, config.minimal_names, config.show_diff, sortkey, config.no_abs_sort)


if __name__ == "__main__":
main()

0 comments on commit bb77bd4

Please sign in to comment.