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-5677] Error message for inapplicable command line options could be clearer #48247

Closed
swift-ci opened this issue Aug 11, 2017 · 2 comments
Closed
Labels
compiler The Swift compiler in itself good first issue Good for newcomers improvement legacy driver Area → compiler: the integrated C++ legacy driver. Succeeded by the swift-driver project

Comments

@swift-ci
Copy link
Collaborator

Previous ID SR-5677
Radar None
Original Reporter jalkut@red-sweater.com (JIRA User)
Type Improvement
Status Closed
Resolution Done
Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Improvement, Driver, StarterBug
Assignee deyton (JIRA)
Priority Medium

md5: 9c5c9edc9a419a8de844d1c26013e2e8

Issue Description:

If 'swift' is invoked with command line options that are only pertinent to 'swiftc', the error message that results should cut to the chase and emphasize that the user probably wants to invoke 'swiftc'. The inclusion of the inapplicable options in the "did you mean" text leads users (well, me anyway) to scrutinize the choice of option, rather than the choice of tool name.

From the Terminal, run:

swift -emit-assembly

Results in an error:

<unknown>:0: error: unsupported option '-emit-assembly' for 'swift'; did you mean 'swiftc -emit-assembly'?

I think it would be less confusing if the error message emphasized the likely wrong choice of command line tool:

<unknown>:0: error: unsupported option '-emit-assembly' for 'swift'; did you mean to use 'swiftc'?

@swift-ci
Copy link
Collaborator Author

Comment by Deyton Sehn (JIRA)

I submitted a PR. I'm not totally sure what the next step is, though. I'm also not sure whether I ran all applicable tests. I updated the ones I could find, though.

@swift-ci
Copy link
Collaborator Author

Comment by Deyton Sehn (JIRA)

The wording I went with was: "error: the option '-emit-assembly' is not supported by 'swift'; did you mean to use 'swiftc'?". This sounds clearer to me but I'm open to the suggested wording in the bug or something completely different 🙂.

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
This issue was closed.
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 good first issue Good for newcomers improvement legacy driver Area → compiler: the integrated C++ legacy driver. Succeeded by the swift-driver project
Projects
None yet
Development

No branches or pull requests

1 participant