Transformation of contrib/ to a python script

Tom de Vries
Mon May 22 07:08:00 GMT 2017

On 05/19/2017 03:47 PM, Martin Liška wrote:
> +if __name__ == '__main__':
> +    if len(sys.argv) > 1:
> +        main()
> +    else:
> +        unittest.main()


when specifying no arguments to the script, I see:
$ ./contrib/
Ran 1 test in 0.000s

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/
usage: [-h] [-f {stdio,quickfix}] file error: the following arguments are required: file


- Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Type: text/x-patch
Size: 19076 bytes
Desc: not available
URL: <>

More information about the Gcc mailing list