[ttx] use GNU-style getopt to intermix options and positional arguments
Fixes https://github.com/fonttools/fonttools/issues/3507
This commit is contained in:
parent
969d09dcaf
commit
511024bdc9
@ -375,7 +375,7 @@ def guessFileType(fileName):
|
||||
|
||||
|
||||
def parseOptions(args):
|
||||
rawOptions, files = getopt.getopt(
|
||||
rawOptions, files = getopt.gnu_getopt(
|
||||
args,
|
||||
"ld:o:fvqht:x:sgim:z:baey:",
|
||||
[
|
||||
|
@ -1018,6 +1018,15 @@ def test_main_ttx_compile_stdin_to_stdout(tmp_path):
|
||||
assert outpath.is_file()
|
||||
|
||||
|
||||
def test_main_gnu_style_opts_and_args_intermixed(tmpdir):
|
||||
# https://github.com/fonttools/fonttools/issues/3507
|
||||
inpath = os.path.join("Tests", "ttx", "data", "TestTTF.ttf")
|
||||
outpath = tmpdir.join("TestTTF.ttx")
|
||||
args = ["-t", "cmap", inpath, "-o", str(outpath)]
|
||||
ttx.main(args)
|
||||
assert outpath.check(file=True)
|
||||
|
||||
|
||||
def test_roundtrip_DSIG_split_at_XML_parse_buffer_size(tmp_path):
|
||||
inpath = Path("Tests").joinpath(
|
||||
"ttx", "data", "roundtrip_DSIG_split_at_XML_parse_buffer_size.ttx"
|
||||
|
Loading…
x
Reference in New Issue
Block a user