On 2019-09-04 10:20, Brian Inglis wrote:
> and ask if you really expect anyone else to use or reproduce this insanity,
> rather than a sane POSIX parser?

I know it's insanity, but it's insanity that almost all Windows programs 
inherit and
implement consistently enough because they use standard libraries or functions
to do the parsing. The Go command line parser used to use CommandLineToArgvW
and only switched away from it due to performance (it's in shell32.dll and that 
takes
a long time to load). I don't know how accurate their manual reproduction is, 
but
they seemed to study the sources I sent pretty carefully.

Anyway, my specific problem is that I have Go code with an array of arguments 
that
I want to pass verbatim (no glob expansion) to a bash script. I've figured out 
how to
override Go's default code for building the command line string, but it's not 
clear how
to correctly construct the command line string. If the POSIX rules are being 
followed,
I'd expect the following to work:

    bash.exe script.sh arg1 "*" arg3

But it always expands the "*" to all the files in the current directory. I've 
also tried \* and
'*', but same problem. So how do I build a command line string that takes each 
argument
literally with no processing?

Thanks,
Stephen


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

Reply via email to