You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, when a user mistypes a command, invoke returns a message like:
$ invoke some_cmd
No idea what 'some_cmd' is!
This error message does not provide any guidance on what the user might have intended. Many modern CLI tools, such as git, offer helpful suggestions when a command is not recognised. For example:
$ git comment
git: 'comment' is not a git command. See 'git --help'.
The most similar command is
commit
I propose enhancing invoke to display similar suggestions when an unknown command is entered.
On a technical side it seems doable by using Levenshtein distance, or any other kind of edit distance.
Proposal
Implement not fixed matching algorithm to suggest most similar known commands.
Modify the error message to guide the user, e.g.:
$ invoke some_cmd
'some_cmd' is not an invoke command. See 'invoke --help'.
The most similar command is
some_command
If multiple similar matches exist, list them in descending order of similarity.
Alternatives Considered:
If this feature is seems to be out of scope for invoke, could you provide guidance on how to extend invoke to achieve this behaviour?
I can find places in code where parsing happens, but I'm not sure how to extend code properly for covering that case.
This improvement would enhance usability and reduce frustration for users who mistype commands.
Would this be a feature you’d consider for invoke? If not, any pointers on implementing it as an extension would be greatly appreciated!
Thanks for your time!
The text was updated successfully, but these errors were encountered:
Currently, when a user mistypes a command, invoke returns a message like:
This error message does not provide any guidance on what the user might have intended. Many modern CLI tools, such as git, offer helpful suggestions when a command is not recognised. For example:
I propose enhancing invoke to display similar suggestions when an unknown command is entered.
On a technical side it seems doable by using Levenshtein distance, or any other kind of edit distance.
Proposal
Implement not fixed matching algorithm to suggest most similar known commands.
Modify the error message to guide the user, e.g.:
If multiple similar matches exist, list them in descending order of similarity.
Alternatives Considered:
If this feature is seems to be out of scope for invoke, could you provide guidance on how to extend invoke to achieve this behaviour?
I can find places in code where parsing happens, but I'm not sure how to extend code properly for covering that case.
This improvement would enhance usability and reduce frustration for users who mistype commands.
Would this be a feature you’d consider for invoke? If not, any pointers on implementing it as an extension would be greatly appreciated!
Thanks for your time!
The text was updated successfully, but these errors were encountered: