tldr-pages / tldr-c-client

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

[Enhancement] search platform list to find a command #116

Open jimmychang851129 opened 2 months ago

jimmychang851129 commented 2 months ago

[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