Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
python/grass/script: split the command string using shell-like syntax…
… on the win32 platform same as on POSIX-compliant platforms (#1908) e.g. run 'd.vect map=census where="cat > 10 AND cat < 20"' with where parameter from Command Prompt CMD/emulator terminal: non-POSIX platform ``` >>> import shlex >>> shlex.split('where="cat > 10 AND cat < 20"', posix=False) ['where="cat', '>', '10', 'AND', 'cat', '<', '20"'] ``` POSIX-compliant platform ``` >>> import shlex >>> shlex.split('where="cat > 10 AND cat < 20"', posix=True) ['where=cat > 10 AND cat < 20'] ``` Under OS MS Windows 'd.vect map=census where="cat > 10 AND cat < 20"' command runned from Command Prompt CMD require use ^ carret symbol for escaping special characters < > ( ) & | , ; ". e.g. 'd.vect map=census where="cat ^> 10 AND cat ^< 20"' --------- Co-authored-by: Anna Petrasova <[email protected]>
- Loading branch information