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

swift -help reports options not available for all swift subcommands without distinguishing them. #68628

Open
dabrahams opened this issue Sep 19, 2023 · 0 comments
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. triage needed This issue needs more specific labels

Comments

@dabrahams
Copy link
Collaborator

For example, -working-directory looks really promising for being able to invoke swift run on a package from outside its working copy. In fact, no dice: if you put the option before run then run is interpreted as the name of a swift file. If you put it after, you get

error: Unknown option '-working-directory'
Usage: swift run [<options>] [<executable>] [<arguments> ...]
  See 'run -help' for more information.

Most tools that have subcommands have a list of universal options and then options for specific commands, and they make the distinction clear in the help. I realize swift is a little different as you want to be able to say swift SomeFile.swift with no command. Maybe you could say there's an implicit command run-script when the thing that would otherwise be a command name has a .swift extension.

@dabrahams dabrahams added bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. triage needed This issue needs more specific labels labels Sep 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. triage needed This issue needs more specific labels
Projects
None yet
Development

No branches or pull requests

1 participant