x-itec / conque

Automatically exported from code.google.com/p/conque
0 stars 0 forks source link

Can't use quoted arguments with spaces #35

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
First of, thats one of the greatest VIM plugin ever! 

As I develop I like to have some automated tests. So I made a mapping that run 
a test script inside my project. I tried to substitute the "VIMs shell" 
(:!python) with ConqueShell and I'm facing the following problem:

When I run 
:ConqueTermSplit bash -c "python tests/test_script.py"
It returns me the following errors:

tests/test_script.py": -c: linha 0: fim do arquivo inesperado enquanto 
procurava por `"'
tests/test_script.py": -c: linha 1: erro de sintaxe: fim prematuro do arquivo

In english would be something like:
tests/test_script.py": -c: line 0: unexpected end of file while searching for 
`"'
tests/test_script.py": -c: line 1: syntax error: unexpected end of file

As a test I tried it with a terminal and everything went normal: 
$ bash -c "python tests/test_script.py"
Running test_script.py...
All tests ok!

After a chmod +x test_script.py I changed the line to :ConqueTermSplit bash -c 
"tests/test_script.py" and everythin went fine too. But there are cases that I 
need to run a certain group of tests:
:ConqueTermSplit bash -c "tests/test_script.py settingsXML.test". 

And the error came back:
settingsXML.test": -c: linha 0: fim do arquivo inesperado enquanto procurava 
por `"'
settingsXML.test": -c: linha 1: erro de sintaxe: fim prematuro do arquivo 

It seems that conque split the arguments with the space.

I'd appreciate a lot if was possible to solve!
Thanks once again and sorry for my bad english!

Original issue reported on code.google.com by magnun.l...@gmail.com on 16 Dec 2010 at 4:13

GoogleCodeExporter commented 8 years ago
Thanks for the bug report. I'll take a look.

Original comment by nicora...@gmail.com on 16 Dec 2010 at 11:24

GoogleCodeExporter commented 8 years ago
I committed a fix for this bug. It will go out with the next release. You can 
change these two lines in autoload/conque_term/conque_subprocess.py to get it 
before then:

Index: autoload/conque_term/conque_subprocess.py
===================================================================
--- autoload/conque_term/conque_subprocess.py   (revision 434)
+++ autoload/conque_term/conque_subprocess.py   (working copy)
@@ -52,6 +52,7 @@
     import fcntl
     import termios
     import struct
+    import shlex

 class ConqueSubprocess:
@@ -71,7 +72,7 @@
     def open(self, command, env={}): # {{{

         # parse command
-        command_arr = command.split()
+        command_arr = shlex.split(command)
         executable = command_arr[0]
         args = command_arr

Original comment by nicora...@gmail.com on 17 Dec 2010 at 12:10

GoogleCodeExporter commented 8 years ago
Thats amazing, it worked perfectly!!

Thanks for the quick response!

Original comment by magnun.l...@gmail.com on 17 Dec 2010 at 2:59