Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add --list argument to list all pages for current platform & common #47

Open
sohang3112 opened this issue May 1, 2024 · 8 comments
Open

Comments

@sohang3112
Copy link

In the output of tldr tldr, this is the last sample command (it must be present in the other tldr clients):

 - List all pages for the current platform and common:
   tldr --list

This --list CLI argument should also be added to tldr-hs.

@sohang3112
Copy link
Author

@psibi I would like to work on this & open a Pull Request to add this argument, please confirm that you would be interested in merging a PR for this.

@psibi
Copy link
Owner

psibi commented Jul 24, 2024

Sounds good to me.

@sohang3112
Copy link
Author

@psibi Ok I'll start working on this. There don't seem to be any Contributing guidelines in this repo - is there anything I should keep in mind while making my PR?

@psibi
Copy link
Owner

psibi commented Jul 24, 2024

I think you might have to update ci as I haven't touched it in quite sometime. Probably convert it to use GitHub actions if that makes things easier.

@sohang3112
Copy link
Author

sohang3112 commented Jul 24, 2024

@psibi I'm not familiar with Azure CI - can you please explain what's the role of .azure/azure-linux-musl.yaml and .azure/azure-linux-template.yaml ? What does musl stand for or mean? I assume musl YAML is using the template YAML, but I'm not sure how - can you point out on which lines in musl YAML is template YAML file being imported & used?

@sohang3112
Copy link
Author

sohang3112 commented Jul 24, 2024

@psibi I'm having an issue with tldr built from source (running with stack exec tldr) - please help with this issue.
In Ubuntu apt repository, tldr command is an older version of tldr-hs. Commands like --version and --update work in the Ubuntu tldr, but not in the version built from source:

# tldr from Ubuntu apt package
$ tldr --version
0.6.4
# running tldr built from source
$ stack exec tldr --version
Invalid option `--version`

Usage: stack exec COMMAND

The commands are defined in src/Tldr/App.hs. For example: (note that this is original source code only, haven't changed anything in any Haskell files):

versionOption :: Parser (a -> a)
versionOption = infoOption (showVersion version) (long "version" <> short 'v' <> help "Show version")

Steps followed to build and run:

stack setup      # install GHC Haskell compiler
stack build      # build executable, installing dependencies
stack test       # install test dependencies and run all tests - all tests pass
stack exec tldr  # runs fine
stack exec tldr --version  # error --version not recognized (full output shown above)

Any idea why the defined commands in the source code are not working? Am I misunderstanding something about building and running from the source? Or is this a bug?

@psibi
Copy link
Owner

psibi commented Jul 24, 2024

What does musl stand for or mean?

Musl based stack is used for building static Haskell binary.

I assume musl YAML is using the template YAML, but I'm not sure how - can you point out on which lines in musl YAML is template YAML file being imported & used?

I don't think any YAML file is being important. You can probably see an example here of how to use github actions: https://github.com/fakedata-haskell/fakedata/blob/master/.github/workflows/tests.yml

Commands like --version and --update work in the Ubuntu tldr, but not in the version built from source:

Can you try this:

stack exec tldr -- --version

Or is this a bug?

I don't think so as I have latest version in my machine:

❯ tldr --version
0.9.2

@sohang3112
Copy link
Author

stack exec tldr -- --version

Thanks - that worked 👍

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

No branches or pull requests

2 participants