On 05/19/2017 03:47 PM, Martin Liška wrote:
+if __name__ == '__main__':
+ if len(sys.argv) > 1:
+ main()
+ else:
+ unittest.main()
Hi,
when specifying no arguments to the script, I see:
...
$ ./contrib/check_GNU_style.py
.
----------------------------------------------------------------------
Ran 1 test in 0.000s
OK
...
In other words, the unit tests are run.
I was expecting some form of help message.
Attached patch splits off a lib file from the script. When running the lib file as a script, we run the unit tests. When running the script without args, we see:
...
$ ./contrib/check_GNU_style.py
usage: check_GNU_style.py [-h] [-f {stdio,quickfix}] file
check_GNU_style.py: error: the following arguments are required: file
...
OK?