Details
-
Type:
Bug
-
Status: Resolved
-
Priority:
Medium
-
Resolution: Done
-
Component/s: Package Manager
-
Labels:None
Description
When SwiftPM is run with an invalid command, it could be caused by a typo or because the user does not remember the precise command. By having SwiftPM detect those cases and suggest the correct command, SwiftPM would be more friendly to use.
This feature could be implemented by modifying ArgumentParser to use the new Ordered Collection Diffing API in Swift 5.1 to compare the invalid command to the available commands and suggest on close matches.
Here's an example what it could look like:
$ swift build --packagepath ../path
error: unknown option --packagepath; use --help to list available options
Did you mean --package-path?