dev-cafe / autocmake

CMake plugin composer.
http://autocmake.org
BSD 3-Clause "New" or "Revised" License
42 stars 18 forks source link

Single quotes around arguments to `--cmake-options` #169

Closed robertodr closed 4 years ago

robertodr commented 8 years ago

Copy-pasting the setup command from the setup_command file does not work, given that the single quotes are removed.

robertodr commented 8 years ago

To be more clear: cat build/setup_command | xclip -sel c followed by pasting gives ERROR: bad input to ./setup.py

bast commented 8 years ago

Confirmed. Will fix it in a short bit.

bast commented 8 years ago

Just found out that it is the shell swallowing those before even Python is called: http://stackoverflow.com/a/19120324

Workaround is additional set of quotes or escaped quotes.

bast commented 8 years ago

I'll leave the issue open until the manual is updated on this.

miroi commented 6 years ago

Ah, this was discussed before...Now I open #224.

bast commented 4 years ago

Looking at it again few years later, the problem is still http://stackoverflow.com/a/19120324.

But then I asked myself, how come it works at all? Under the hood it's docopt parsing the arguments and also docopt gets something without quotes but still figures it out.

What one could is to print arguments from setup to preserve the options and they contain quotes. But they are not exactly what you passed to setup since setup has defaults. So it will be setup flags plus defaults.

bast commented 4 years ago

One thing we could do is to compare values in arguments with substrings in sys.argv and "doctor" those quotes back in.