Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove WINNT check for argument processing #86

Open
jamesjohnmcguire opened this issue Dec 15, 2019 · 2 comments
Open

Remove WINNT check for argument processing #86

jamesjohnmcguire opened this issue Dec 15, 2019 · 2 comments

Comments

@jamesjohnmcguire
Copy link

Change
if (php_sapi_name() === 'cli' && PHP_OS != 'WINNT') {
to
if (php_sapi_name() === 'cli') {

Otherwise, the command line arguments are completely ignored on Windows.

At some points, you may want to check the OS, and not try some actions it is not capable of. However, at the very beginning of the script, I don't see the rationale. I have changed this on my local copy and it is working just fine, including the color support.

The color support might be working because of extensions I have installed. But even so, should not be merged with command line checking.

I tested only with 'file' and 'url' command line arguments.

@vezaynk
Copy link
Owner

vezaynk commented Dec 16, 2019

Where are you running it to get colour support? I could never manage the standard cmd.exe to pick them up, so that is surprising to me.

I don't remember why I added the check there, I'll swift through the commits later to update as needed.

How does blacklist behave on Windows? If something were to break, it would be that.

@jamesjohnmcguire
Copy link
Author

I just run it from a standard cmd.exe window. However, I installed ansicon (http://adoxa.altervista.org/ansicon/) on my path, which I think may be providing the color support. In any case, there are also various bash shells that run on Windows, such as the one that comes with git. the OS will still be winnt. So the checks may need to be more fine grained.

I didn't try anything about blacklist. If there is something quick to try, I can try.

The main thing, is to make sure the command line arguments are processed, even when running on windows.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants