Updated exit and input args handling

Signed-off-by: Maciej Kurc <mkurc@antmicro.com>
This commit is contained in:
Maciej Kurc 2019-06-07 11:26:05 +02:00
parent 626c0f7e66
commit 53db46b2d5
1 changed files with 6 additions and 3 deletions

View File

@ -8,6 +8,7 @@ and checks if those pips are listed there.
Missing segbits for pips are reported as well as missing segbit files. Missing segbits for pips are reported as well as missing segbit files.
""" """
import sys
import logging import logging
import json import json
import argparse import argparse
@ -74,7 +75,7 @@ def read_segbits(segbits_file):
# ============================================================================= # =============================================================================
def main(): def main(argv):
""" """
The main The main
""" """
@ -100,7 +101,7 @@ def main():
default=[], default=[],
help="Tile type name regex list for tile types to include") help="Tile type name regex list for tile types to include")
args = parser.parse_args() args = parser.parse_args(argv[1:])
logging.basicConfig(level=50 - args.verbose * 10, format="%(message)s") logging.basicConfig(level=50 - args.verbose * 10, format="%(message)s")
@ -214,8 +215,10 @@ def main():
else: else:
logging.warning(" OK: no pips") logging.warning(" OK: no pips")
return 0
# ============================================================================= # =============================================================================
if __name__ == "__main__": if __name__ == "__main__":
main() sys.exit(main(sys.argv))