tldr-pages / tldr-c-client

C command-line client for tldr pages
MIT License
293 stars 50 forks source link

Search other platform folders for command if not found under current platform or common #96

Open aidan-gibson opened 1 year ago

aidan-gibson commented 1 year ago

tldr scriptreplay via c-client returns "this page doesn't exist yet" (of note, this also happens on https://tldr.ostera.io/)

Yet the node tldr returns the tldr page.

MasterOdin commented 1 year ago

Relevant page: https://github.com/tldr-pages/tldr/blob/main/pages/linux/scriptreplay.md

What OS / distro are you on?

owenvoke commented 1 year ago

The web client works correctly, however as it's a Linux page, you have to prefix it. https://tldr.ostera.io/linux/scriptreplay

aidan-gibson commented 1 year ago

macOS Ventura 13.1

MasterOdin commented 1 year ago

The C client will only look for a page for your current OS + common if you don't specify the --platform flag. The client spec does recommend this however:

If a page is not available for either the host platform or the common platform, then clients SHOULD search other platforms and display a page from there - along with a warning message.

The fix here would be to make the C client look at other platforms till it finds a page.

jimmychang851129 commented 2 months ago

After analysis, I think the function to be enhanced is print_tldrpage, I have started to work on it, can I take on this issue?