Skip to content

Conversation

@packrat386
Copy link
Contributor

What does it do?

Add --list option

This will list each of the commands for which there is an entry in the
current local database. It lists only packages for the current
platform or can be overwritten by the --platform flag. It will update
the local database if there is not one.

Why the change?

Requested in #22 and #36

How can this be tested?

Compile the new version of and run tldr --list. It should list everything installed locally.

Where to start code review?

The print_tldrlist and parse_tldrlist functions in parser.c contain the meat of the implementation.

Relevant tickets?

Questions?

  • Does this output format make sense? I have an example of what it looks like here
  • The code for ensuring that a provided platform flag is a supported platform is currently copied between print_tldrlist and print_tldrpage. My thought was that it might be best to refactor this into a separate check that we run when we parse flags. Is this a change you'd like to see? And if so, should I make that here or in a separate PR?
  • I tried to copy the pattern of the existing print_tldrpage and parse_tldrpage. Does it make sense to use that same naming scheme? Should this perhaps go in a different file?

We wil need to be able to get the "default" platform to list the pages
for the right platform.
This will list each of the commands for which there is an entry in the
current local database. It lists only packages for the current
platform or can be overriden by the --platform flag. It will update
the local database if there is not one.
@zlatanvasovic zlatanvasovic merged commit 7158acf into tldr-pages:master May 27, 2020
@zlatanvasovic
Copy link
Contributor

Thanks!

superatomic added a commit to superatomic/tldr-c-client that referenced this pull request Jun 23, 2022
The `--list` option was introduced in tldr-pages#42 and was requested in tldr-pages#22 & tldr-pages#36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants