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

Consider a different exit code and message when the input is spelled correctly #22

Closed
adam-gaia opened this issue Dec 18, 2022 · 1 comment · Fixed by #23
Closed

Consider a different exit code and message when the input is spelled correctly #22

adam-gaia opened this issue Dec 18, 2022 · 1 comment · Fixed by #23
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@adam-gaia
Copy link

I would really appreciate a different exit code when my input word is spelled correctly vs when it is not.

Additionally, I would like to see a different message noting that my input was spelled correctly. Sometimes (when I forget to specify -v), I have to take a moment to double check if the first result is different from my input word.

$ dym supercalifragilisticexpialidocious # correct spelling
supercalifragilisticexpialidocious is spelled correctly
$ echo $?
0

$ dym supercalifragilisticexpialidociouX # last char typo
Did you mean?
1. supercalifragilisticexpialidocious
2. supercalifragilistic
3. superphlogistication
4. superartificiality
5. supercapabilities
$ echo $?
1

Regardless, thanks for your work on dym. It is very helpful as is!

@hisbaan hisbaan added enhancement New feature or request good first issue Good for newcomers labels Dec 18, 2022
@hisbaan
Copy link
Owner

hisbaan commented Dec 18, 2022

Thank you for using dym! It's great to know people actually find it helpful :)

We can certainly add that functionality but I think printing out the list would still be a good idea since you can spell a word correctly and still want to get the other words. Something like:

$ dym x
x is spelled correctly

Did you mean:
1. x
2. y
3. z
...

I was also thinking about highlighting the matching entry in some color like orange or red. I was working on a feature to do diff-like highlighting on every word but the complexities and a lack of free time led to that going on the back burner.

As for the exit code anything other than 0 typically indicates failure, I personally don't want to classify a valid result as a failure. The main reason is it would break many people's script integrations that expect a 0 exit code on success.

Let me know if you have any suggestions, otherwise I'll add the features we discussed here some time in the next few days

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants