paulirish / git-open

Type `git open` to open the GitHub page or website for a repository in your browser.
MIT License
3.29k stars 247 forks source link

Remove openopt, allow spaces in $BROWSER #132

Closed neersighted closed 5 years ago

neersighted commented 5 years ago

Remove the openopt variable, instead opting to allow spaces in $BROWSER.

$BROWSER as used by the XDG implementation allows spaces (and %s printf-style formatting strings), and is actually a PATH-style list. While this patch doesn't make git-open compliant with the XDG-style variable, it does allow for the use of BROWSER="powershell.exe Start" in the environment.

derimagia commented 5 years ago

Coincidentally i ran into this issue not too long ago in other scripts. You said it's part of the XDG Spec, do you know which expect spec it's a part of / do you have a link to it? I know it's in there, I'm just not sure which one.

I don't think we need 100% compliance in this PR, but for reference here's what xdg-open does: https://github.com/freedesktop/xdg-utils/blob/74776910981b60877d25b1ab9587e5928af1e9c4/scripts/xdg-open.in#L374-L400

neersighted commented 5 years ago

That's actually a good question. I remember reading a description years ago, but I'm not sure where it was. Usually I refer to the implementation in xdg-open or Python's webbrowser.

neersighted commented 5 years ago

I think this is good to go, now. Let me know if you have any more concerns.

derimagia commented 5 years ago

Looks good, thanks