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

[SR-11304] Warn when passing command-line arguments intended for 'swift' to the script being run #53705

Open
swift-ci opened this issue Aug 14, 2019 · 0 comments
Labels
compiler The Swift compiler in itself improvement

Comments

@swift-ci
Copy link
Collaborator

Previous ID SR-11304
Radar None
Original Reporter owenvoorhees (JIRA User)
Type Improvement
Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Improvement
Assignee None
Priority Medium

md5: 6af0f5e2968b62987a7e90117a51066b

Issue Description:

https://forums.swift.org/t/import-compiler-builtins/27869/10 for context

brentdax (JIRA User) pointed out that:
"When you run

swift myscript.swift

, arguments after the filename become arguments to the script, available in CommandLine.arguments, rather than arguments to Swift." This makes sense, but can pretty easily lead to surprising behavior.

It would be nice if when processing arguments, swift could look for potentially valid swift arguments after the filename, and provide some kind of warning. We'd probably want to avoid warning on some of the single letter flags that might be commonly used by scripts though, so this might be tricky.

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler The Swift compiler in itself improvement
Projects
None yet
Development

No branches or pull requests

1 participant