diff options
author | Ben Gamari <ben@smart-cactus.org> | 2020-02-05 20:12:23 -0500 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2020-02-14 10:17:00 -0500 |
commit | 8cabb384775adacf8326f7dd2cf99291da8dddbb (patch) | |
tree | c6ddb2dd5120c9b257d08794324f9aef16ca7624 | |
parent | 06d60c66d6355e895c7e46275f295b721d63fa92 (diff) | |
download | haskell-8cabb384775adacf8326f7dd2cf99291da8dddbb.tar.gz |
compare-flags: Fix output
-rwxr-xr-x | docs/users_guide/compare-flags.py | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/docs/users_guide/compare-flags.py b/docs/users_guide/compare-flags.py index d18abb4d7a..5b588d99e0 100755 --- a/docs/users_guide/compare-flags.py +++ b/docs/users_guide/compare-flags.py @@ -54,6 +54,9 @@ def read_ghc_flags(ghc_path: str) -> Set[str]: if not expected_undocumented(flag) if flag != ''} +def error(s: str): + print(s, file=sys.stderr) + def main() -> None: import argparse parser = argparse.ArgumentParser() @@ -70,16 +73,16 @@ def main() -> None: undocumented = ghc_flags - doc_flags if len(undocumented) > 0: - print('Found {len_undoc} flags not documented in the users guide:') - print('\n'.join(' {}'.format(flag) for flag in sorted(undocumented))) - print() + error('Found {len_undoc} flags not documented in the users guide:'.format(len_undoc=len(undocumented)), ) + error('\n'.join(' {}'.format(flag) for flag in sorted(undocumented))) + error('') failed = True now_documented = EXPECTED_UNDOCUMENTED.intersection(doc_flags) if len(now_documented) > 0: - print('Found flags that are documented yet listed in {}:'.format(EXPECTED_UNDOCUMENTED_PATH)) - print('\n'.join(' {}'.format(flag) for flag in sorted(now_documented))) - print() + error('Found flags that are documented yet listed in {}:'.format(EXPECTED_UNDOCUMENTED_PATH)) + error('\n'.join(' {}'.format(flag) for flag in sorted(now_documented))) + error('') failed = True if failed: |