Skip to content

Remove forward slash as command line switch #1175

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

Merged
merged 2 commits into from
Jul 22, 2024

Conversation

sookach
Copy link
Contributor

@sookach sookach commented Jul 21, 2024

Fixes #1174. According to the docs, forward slashes are not used for any flags (and I can't think of a good reason for them to be, given the problems it would cause, like the mentioned issue), so this pr just removes forward slashes for command line options.

@jarzec
Copy link
Contributor

jarzec commented Jul 21, 2024

I think this was added for compatibility with Windows where / is pretty much the default way to provide command line arguments.
I agree that the everlasting choice to use of \ in paths and / for command line arguments on Windows is... breakneck (i.e. is a pain in the... neck 😉)

@hsutter
Copy link
Owner

hsutter commented Jul 21, 2024

Thanks! Yes, the issue is Windows familiarity.

Maybe I'll just emit that warning if there's no . character in the command-line argument!

@sookach
Copy link
Contributor Author

sookach commented Jul 22, 2024

Thanks! Yes, the issue is Windows familiarity.

Maybe I'll just emit that warning if there's no . character in the command-line argument!

That's a good thought but I'm not too sure if that will work. The linked issue is from a user trying to use an absolute file path, so it shouldn't have a '.'

@bluetarpmedia
Copy link
Contributor

That's a good thought but I'm not too sure if that will work. The linked issue is from a user trying to use an absolute file path, so it shouldn't have a '.'

If the input file is filename.cpp2 or filename.h2 then it will, though I'm not sure if that's a requirement for the source file to have an extension.

@sookach
Copy link
Contributor Author

sookach commented Jul 22, 2024

That's a good thought but I'm not too sure if that will work. The linked issue is from a user trying to use an absolute file path, so it shouldn't have a '.'

If the input file is filename.cpp2 or filename.h2 then it will, though I'm not sure if that's a requirement for the source file to have an extension.

Ahh, my bad, I misunderstood Herb's original comment. I thought he meant a leading dot. All good then.

@sookach sookach force-pushed the pr/issue-1174 branch 2 times, most recently from ae3da8c to acaa841 Compare July 22, 2024 01:04
@sookach
Copy link
Contributor Author

sookach commented Jul 22, 2024

Cool, I updated the pr to skip over arguments that begin with a forward slash and contain a dot.

@hsutter
Copy link
Owner

hsutter commented Jul 22, 2024

Thanks!

@hsutter hsutter merged commit 15f9be1 into hsutter:main Jul 22, 2024
28 checks passed
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

Successfully merging this pull request may close these issues.

[BUG] Absolute paths no longer work as input
4 participants