summaryrefslogtreecommitdiff
path: root/docs/users_guide/compare-flags.py
diff options
context:
space:
mode:
Diffstat (limited to 'docs/users_guide/compare-flags.py')
-rwxr-xr-xdocs/users_guide/compare-flags.py13
1 files changed, 9 insertions, 4 deletions
diff --git a/docs/users_guide/compare-flags.py b/docs/users_guide/compare-flags.py
index 81a11b90e5..e858e3011b 100755
--- a/docs/users_guide/compare-flags.py
+++ b/docs/users_guide/compare-flags.py
@@ -49,8 +49,11 @@ def read_documented_flags(doc_flags) -> Set[str]:
def read_ghc_flags(ghc_path: str) -> Set[str]:
ghc_output = subprocess.check_output([ghc_path, '--show-options'])
- flags = {flag.strip() for flag in ghc_output.decode('UTF-8').split('\n')}
- return {flag for flag in flags
+ ghci_output = subprocess.check_output([ghc_path, '--interactive', '--show-options'])
+
+ return {flag
+ for flag in ghc_output.decode('UTF-8').splitlines() +
+ ghci_output.decode('UTF-8').splitlines()
if not expected_undocumented(flag)
if flag != ''}
@@ -61,9 +64,11 @@ def main() -> None:
import argparse
parser = argparse.ArgumentParser()
parser.add_argument('--ghc', type=argparse.FileType('r'),
- help='path of GHC executable')
+ help='path of GHC executable',
+ required=True)
parser.add_argument('--doc-flags', type=argparse.FileType(mode='r', encoding='UTF-8'),
- help='path of ghc-flags.txt output from Sphinx')
+ help='path of ghc-flags.txt output from Sphinx',
+ required=True)
args = parser.parse_args()
doc_flags = read_documented_flags(args.doc_flags)