VerySleepy / verysleepy

Very Sleepy, a sampling CPU profiler for Windows
http://www.codersnotes.com/sleepy
GNU General Public License v2.0
1.05k stars 103 forks source link

can't run sleepy from command line with arguments in msys2 #15

Closed ellisonch closed 9 years ago

ellisonch commented 9 years ago

When I try running sleepy from the command line with arguments in msys2, I get an error:

$ sleepy /r:a.exe image

The same thing happens if I surround a.exe with quotes.

Even running sleepy /h fails: image Though it is a little revealing, because something turned "/h" into "H:\"

If instead I call "cmd", and have it run sleepy, everything works: cmd /C "sleepy /r:a.exe"

And I can pass program arguments like: cmd /C "sleepy /r:\"a.exe foo\""

I tested it from cygwin, and cygwin is able to run sleepy fine directly, without needing to go through cmd.

I'm installed msys2 from msys2-x86_64-20141113.exe and I have windows 7.

CyberShadow commented 9 years ago

If you run Very Sleepy from MSys2 with /h, it is created with this command line:

"C:\Program Files\Very Sleepy 0.90\sleepy.exe" H:/

Thus, msys2 is translating the /h parameter, which it thinks of as a Unix path, into a Windows path.

As such, nothing can be done on Very Sleepy's side, since it doesn't know what parameters the user typed.

You can try reporting this issue to MSys2 developers. It's possible that a workaround exists which doesn't involve cmd (such as a specialized parameter syntax).

ellisonch commented 9 years ago

You're right! In case it might help others, it seems like using an extra "/" to escape works. So, sleepy //h works just fine.

Thanks!