|
14 | 14 |
|
15 | 15 | def main(): |
16 | 16 | parser = argparse.ArgumentParser(description='FOSSLight Prechecker', prog='fosslight_prechecker', add_help=False) |
17 | | - parser.add_argument('mode', nargs='?', help='lint | convert | add', choices=['lint', 'convert', 'add']) |
18 | | - parser.add_argument('--path', '-p', help='Path to check', type=str, dest='path', default="") |
19 | | - parser.add_argument('--format', '-f', help='Format of ouput', type=str, dest='format', default="") |
20 | | - parser.add_argument('--output', '-o', help='Output file name', type=str, dest='output', default="") |
21 | | - parser.add_argument('--no', '-n', help='Disable automatic exclude mode', action='store_true', dest='disable') |
22 | | - parser.add_argument('--license', '-l', help='License name to add', type=str, dest='license', default="") |
23 | | - parser.add_argument('--copyright', '-c', help='Copyright to add', type=str, dest='copyright', default="") |
24 | | - parser.add_argument('--help', '-h', help='Print help message', action='store_true', dest='help') |
25 | | - parser.add_argument('--ignore', '-i', help='Do not write log to file', action='store_false', dest='log') |
26 | | - parser.add_argument('--version', '-v', help='Print FOSSLight Prechecker version', action='store_true', dest='version') |
| 17 | + parser.add_argument('mode', nargs='?', help='lint | convert | add', choices=['lint', 'add', 'convert']) |
| 18 | + parser.add_argument('-h', '--help', help='Print help message', action='store_true', dest='help') |
| 19 | + parser.add_argument('-i', '--ignore', help='Do not write log to file', action='store_false', dest='log') |
| 20 | + parser.add_argument('-v', '--version', help='Print FOSSLight Prechecker version', action='store_true', dest='version') |
| 21 | + parser.add_argument('-n', '--no', help='Disable automatic exclude mode', action='store_true', dest='disable') |
| 22 | + parser.add_argument('-p', '--path', help='Path to check', type=str, dest='path', default="") |
| 23 | + parser.add_argument('-f', '--format', help='Format of ouput', type=str, dest='format', default="") |
| 24 | + parser.add_argument('-o', '--output', help='Output file name', type=str, dest='output', default="") |
| 25 | + parser.add_argument('-l', '--license', help='License name to add', type=str, dest='license', default="") |
| 26 | + parser.add_argument('-c', '--copyright', help='Copyright to add', type=str, dest='copyright', default="") |
27 | 27 | try: |
28 | | - args, unknown = parser.parse_known_args() |
| 28 | + args = parser.parse_args() |
29 | 29 | except SystemExit: |
30 | | - print_help_msg() |
| 30 | + sys.exit(0) |
31 | 31 |
|
32 | | - if args.help or unknown: |
| 32 | + if args.help: |
33 | 33 | print_help_msg() |
34 | 34 |
|
35 | 35 | if args.version: |
|
0 commit comments