git @ Cat's Eye Technologies Eqthy / 5a4d19a
Replace --bare command line flag with --input-format choices. Chris Pressey 1 year, 2 months ago
2 changed file(s) with 9 addition(s) and 7 deletion(s). Raw diff Collapse all Expand all
9797 the semantics of the language.
9898
9999 -> Functionality "Parse Eqthy Document" is implemented by shell command
100 -> "python3 bin/eqthy --bare --dump-ast %(test-body-file) 2>&1 > /dev/null && echo 'ok'"
100 -> "python3 bin/eqthy --input-format=bare --dump-ast %(test-body-file) 2>&1 > /dev/null && echo 'ok'"
101101
102102 ### Parse Eqthy Document
103103
139139 ### Check Eqthy Document
140140
141141 -> Functionality "Check Eqthy Document" is implemented by shell command
142 -> "python3 bin/eqthy --bare %(test-body-file) && echo 'ok'"
142 -> "python3 bin/eqthy --input-format=bare %(test-body-file) && echo 'ok'"
143143
144144 -> Tests for functionality "Check Eqthy Document"
145145
2424
2525 argparser.add_argument(
2626 'input_files', nargs='+', metavar='FILENAME', type=str,
27 help='Source files containing the scenario descriptions'
27 help='Path to source file containing an Eqthy document'
2828 )
2929
3030 argparser.add_argument(
31 "--bare",
32 action="store_true",
33 help="Treat the input as bare Eqthy that is not embedded in Markdown"
31 "--input-format",
32 type=str,
33 choices=("markdown", "bare"),
34 default="markdown",
35 help="Select the format of the input files. Default is Eqthy embedded in Markdown."
3436 )
3537 argparser.add_argument(
3638 "--dump-ast",
5961 with codecs.open(filename, 'r', encoding='UTF-8') as f:
6062 text = f.read()
6163
62 if not options.bare:
64 if options.input_format == 'markdown':
6365 text = extract_from_markdown(text)
6466
6567 p = Parser(text, filename)