diff options
author | Giuliano Belinassi <giuliano.belinassi@usp.br> | 2020-08-22 17:43:43 -0300 |
---|---|---|
committer | Giuliano Belinassi <giuliano.belinassi@usp.br> | 2020-08-22 17:43:43 -0300 |
commit | a926878ddbd5a98b272c22171ce58663fc04c3e0 (patch) | |
tree | 86af256e5d9a9c06263c00adc90e5fe348008c43 /contrib/check-params-in-docs.py | |
parent | 542730f087133690b47e036dfd43eb0db8a650ce (diff) | |
parent | 07cbaed8ba7d1b6e4ab3a9f44175502a4e1ecdb1 (diff) | |
download | gcc-devel/autopar_devel.zip gcc-devel/autopar_devel.tar.gz gcc-devel/autopar_devel.tar.bz2 |
Merge branch 'autopar_rebase2' into autopar_develdevel/autopar_devel
Quickly commit changes in the rebase branch.
Diffstat (limited to 'contrib/check-params-in-docs.py')
-rwxr-xr-x | contrib/check-params-in-docs.py | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/contrib/check-params-in-docs.py b/contrib/check-params-in-docs.py index 6cff090..dfbfa3d 100755 --- a/contrib/check-params-in-docs.py +++ b/contrib/check-params-in-docs.py @@ -22,16 +22,19 @@ # # -import sys -import json import argparse +from itertools import dropwhile, takewhile -from itertools import * def get_param_tuple(line): - line = line.strip() + line = line.strip().replace('--param=', '') i = line.find(' ') - return (line[:i], line[i:].strip()) + name = line[:i] + if '=' in name: + name = name[:name.find('=')] + description = line[i:].strip() + return (name, description) + parser = argparse.ArgumentParser() parser.add_argument('texi_file') @@ -49,8 +52,8 @@ for line in open(args.params_output).readlines(): # Find section in .texi manual with parameters texi = ([x.strip() for x in open(args.texi_file).readlines()]) -texi = dropwhile(lambda x: not 'item --param' in x, texi) -texi = takewhile(lambda x: not '@node Instrumentation Options' in x, texi) +texi = dropwhile(lambda x: 'item --param' not in x, texi) +texi = takewhile(lambda x: '@node Instrumentation Options' not in x, texi) texi = list(texi)[1:] token = '@item ' |