parse commands in posix mode

If posix=False, quotes are not stripped from parsed tokens.
This commit is contained in:
Maximilian Hils 2017-12-31 17:31:21 +01:00 committed by GitHub
parent d9d4d15ee0
commit 44d97848e5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -24,7 +24,7 @@ def verify_arg_signature(f: typing.Callable, args: list, kwargs: dict) -> None:
def lexer(s): def lexer(s):
# mypy mis-identifies shlex.shlex as abstract # mypy mis-identifies shlex.shlex as abstract
lex = shlex.shlex(s) # type: ignore lex = shlex.shlex(s, posix=True) # type: ignore
lex.wordchars += "." lex.wordchars += "."
lex.whitespace_split = True lex.whitespace_split = True
lex.commenters = '' lex.commenters = ''