The queston, of course, is how to pass a argument with embedded spaces. The solution is standard -- quoting. So
    show_args.exe "here we" go
Then, it's surely good to be able to insert just quote character, without any special meaning. Of course, we need to quote it with backslash:
    show_args.exe "the movie \"untitled\""
We probably might want to add literal backslash before quotation mark. I'm already at lost why anybody would need it but anyway:
    show_args.exe \\"here we go"
This sounds reasonable, right? But there's one little detail: the backslashes need to have special meaning only before quote. Anywere else double backslash need not be treated specially. This is pretty interesting observration, and is exactly what happens in windows command line. Which proves that not all smart ideas lead to good interface -- the fact that \\ means one backslash before quote and two backslashes elsewhere is so confusing. I'd even say it's the second worst command line syntax idea -- the first being that all options should come before all arguments.
No comments:
Post a Comment