TeX-Live / texdoc

Find and view documentation in TeX Live
https://tug.org/texdoc/
GNU General Public License v3.0
47 stars 8 forks source link

Prompt for no "good" results #96

Open wtsnjp opened 1 year ago

wtsnjp commented 1 year ago

Currently, the only options are to open the top 3 files or perform an online search, but we would like to add an option to show all results (i.e., switch to --showall mode).

"Y to search online" does not seem appropriate in this case. We want to change the prompt to something like the following.

Enter number of file to view, S to show all matches, O to search online, or any other key to exit:

Originally posted by @kberry in https://github.com/TeX-Live/texdoc/issues/94#issuecomment-1442703323

kberry commented 1 year ago
``` Enter a number of the above file to view, S to show all matches, O
to search online, or any other key to exit: ```

Yes. Thanks for reposting this.

It belatedly occurred to me that another possibility would be to introduce a configuration variable for what to do in the "no good hits" case. Something like, off the top of my head, negativematch = top3 | showall

For myself, I don't particularly need or want to be told "Unfortunately, there are no good matches for" (or the online search). The verbosity is understandable as the default, but I'd rather just see the list of whatever matches there are.

I, and I think plenty of other people, routinely type random substrings to texdoc in hopes of getting something decent. It's also often unknown whether a given string will be a "good match" or not.

Thanks, Karl

wtsnjp commented 1 year ago

Adding options to the prompts is easy, but adding new configuration items will be a more significant change, so let me split the issue up again.