Skip to content

Commit 4f9dede

Browse files
committed
CLI option to show me the errors without needing to write out a file
1 parent 52da4d5 commit 4f9dede

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

make_schema_doc.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -918,14 +918,22 @@ def validate_schema_remarks():
918918

919919

920920
if __name__ == "__main__":
921-
if len(sys.argv) > 1 and sys.argv[1] == '--validate':
921+
if len(sys.argv) == 2 and sys.argv[1] == '--validate':
922922
validate_schema_remarks()
923+
elif len(sys.argv) == 3:
924+
(first, last) = sys.argv[1:]
925+
try:
926+
(header, body, footer) = make_tables(first, last)
927+
except BzSchemaProcessingException as e:
928+
print(e.message)
929+
sys.exit()
930+
print("Succeeded!")
923931
else:
924932
try:
925933
(first, last, filename) = sys.argv[1:]
926934
except ValueError:
927935
print(
928-
"Please pass the starting and ending schema versions and a filename to output to,"
936+
"Please pass the starting and ending schema versions and an optional filename to output to,"
929937
)
930938
print("or pass --validate to check for version number sanity.")
931939
sys.exit()

0 commit comments

Comments
 (0)