tldr-c-client icon indicating copy to clipboard operation
tldr-c-client copied to clipboard

[Enhancement] search platform list to find a command

Open jimmychang851129 opened this issue 1 year ago • 0 comments
trafficstars

[Enhancement] Search commands in all platforms if it is not found in current user's platform

What does it do?

make tldr-c-client to find a command in all platforms if it is not found in user's platform.

Why the change?

To enhance tldr-c-client as mentioned in https://github.com/tldr-pages/tldr-c-client/issues/96

How can this be tested?

run tldr <command> where the command is not found in current user's platform. After this change, it should be able to find the command description even it is not in user's platform.

Where to start code review?

Main change: src/parser.c

  1. abstract the logic and make the function name more descriptive (i.e. IsPageInPlatformList)
  2. add platformList in tldr.h for scalability. Developers only have to update the list in tldr.h, and the list can be used in any *.c files.

Relevant tickets?

https://github.com/tldr-pages/tldr-c-client/issues/96

Questions?

<Ask us anything!>

Checklist

  • [X] I have checked there aren't any existing PRs open to fix this issue/add this feature.
  • [X] I have compiled the code with make and tested the change in an active installation with sudo make install.

jimmychang851129 avatar May 01 '24 08:05 jimmychang851129