diff options
Diffstat (limited to 'test/Fortran/fixture/myfortran_flags.py')
-rw-r--r-- | test/Fortran/fixture/myfortran_flags.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/test/Fortran/fixture/myfortran_flags.py b/test/Fortran/fixture/myfortran_flags.py new file mode 100644 index 0000000..b972e35 --- /dev/null +++ b/test/Fortran/fixture/myfortran_flags.py @@ -0,0 +1,16 @@ +import getopt +import sys +comment = ('#' + sys.argv[1]).encode() +opts, args = getopt.getopt(sys.argv[2:], 'cf:o:xy') +optstring = '' +length = len(comment) +for opt, arg in opts: + if opt == '-o': out = arg + elif opt not in ('-f', '-K'): optstring = optstring + ' ' + opt +infile = open(args[0], 'rb') +outfile = open(out, 'wb') +outfile.write((optstring + "\n").encode()) +for l in infile.readlines(): + if l[:length] != comment: + outfile.write(l) +sys.exit(0) |