dev-cafe/autocmake

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

Closed this issue · 7 comments

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

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

bast commented

Confirmed. Will fix it in a short bit.

bast commented

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

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

miroi commented

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

bast commented

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

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