psibi / tldr-hs

Haskell tldr client
BSD 3-Clause "New" or "Revised" License
93 stars 14 forks source link

Formatting: No space after full stop #36

Closed Jonta closed 1 year ago

Jonta commented 3 years ago

Expected:

Displays simple help pages for command-line tools, from the tldr-pages project. More information: https://tldr.sh.

Actual:

Displays simple help pages for command-line tools, from the tldr-pages project.More information: https://tldr.sh.

Version: 0.4.0.1-1build2 From sudo apt get install tldr on Ubuntu 20.04 LTS

psibi commented 3 years ago

@Jonta Can you try the latest version available as a binary from here: https://github.com/psibi/tldr-hs/releases/tag/v0.9.0

Jonta commented 3 years ago

(Still happens in 0.6.4)

@Jonta Can you try the latest version available as a binary from here: https://github.com/psibi/tldr-hs/releases/tag/v0.9.0

@psibi

tldr - Simplified and community-driven man pages

Usage: tldr [-v|--version] ((-u|--update) | [-p|--platform PLATFORM]
            [-L|--language LOCALE] COMMAND | (-a|--about))
            [--auto-update-interval DAYS]
  tldr Client program

Available options:
  -h,--help                Show this help text
  -v,--version             Show version
  -u,--update              Update offline cache of tldr pages
  -p,--platform PLATFORM   Prioritize specfic platform while searching. Valid
                           values include linux, osx, windows, sunos
  -L,--language LOCALE     Preferred language for the page returned
  COMMAND                  name of the command
  -a,--about               About this program
  --auto-update-interval DAYS
                           Perform an automatic update if the cache is older
                           than DAYS
No tldr entry for tar
Downloading tldr pages to /home/jonta/.local/share/tldr
Segmentation fault (core dumped)

~ ls ~/.local/share/tldr

[Empty directory]

How do I tell that release of tldr to use the pages already stored there?

psibi commented 3 years ago
Downloading tldr pages to /home/jonta/.local/share/tldr
Segmentation fault (core dumped)

This sounds scary and seems to be something is going wrong. What OS are you in ?

How do I tell that release of tldr to use the pages already stored there?

By default it uses the locally cached pages. In your case, it doesn't seem to work because -u has failed because of segmentation fault. Can you try again with -u and see if it's reproducible ?

Jonta commented 3 years ago

This sounds scary and seems to be something is going wrong. What OS are you in ?

Ubuntu 21.04

By default it uses the locally cached pages. In your case, it doesn't seem to work because -u has failed because of segmentation fault. Can you try again with -u and see if it's reproducible ?

Reproducible

I ran an strace on ./tldr -u, and 99% of it seem to be blocks like this (repeated with I'm guessing all .md-files):

stat("/home/jonta/.local/share/tldr/tldr/pages.de/common/git-apply.md", {st_mode=S_IFREG|0664, st_size=767, ...}) = 0
access("/home/jonta/.local/share/tldr/tldr/pages.de/common/git-apply.md", R_OK) = 0
access("/home/jonta/.local/share/tldr/tldr/pages.de/common/git-apply.md", W_OK) = 0
access("/home/jonta/.local/share/tldr/tldr/pages.de/common/git-apply.md", X_OK) = -1 EACCES (Permission denied)
stat("/home/jonta/.local/share/tldr/tldr/pages.de/common/git-apply.md", {st_mode=S_IFREG|0664, st_size=767, ...}) = 0
chmod("/home/jonta/.local/share/tldr/tldr/pages.de/common/git-apply.md", 0100764) = 0
lstat("/home/jonta/.local/share/tldr/tldr/pages.de/common/git-apply.md", {st_mode=S_IFREG|0764, st_size=767, ...}) = 0
unlink("/home/jonta/.local/share/tldr/tldr/pages.de/common/git-apply.md") = 0

Is it checking whether the .md-files are executable? Ref. X_OK) = -1 EACCES (Permission denied)

psibi commented 3 years ago

@Jonta Thanks, the strace output is quite helpful.

Do you have write permission for ~/.local/share/tldr ?

Jonta commented 3 years ago

@Jonta Thanks, the strace output is quite helpful.

Do you have write permission for ~/.local/share/tldr ?

@psibi

Ah, meant to include that

drwxrwxr-x

Both after ./tldr -u and after tldr -u (the latter restoring the cache)

Jonta commented 3 years ago

The file above (~./local/share/tldr/tldr/pages.de/common/git-apply.md) has -rw-rw-r--

psibi commented 3 years ago

@Jonta I just tested the master version in my machine and it seems to work (but I'm using NixOS). Can you try these things:

Can you check if that changes things for you ?

Jonta commented 3 years ago

@Jonta I just tested the master version in my machine and it seems to work (but I'm using NixOS). Can you try these things:

rm -rf ~/.local/share/tldr/tldr
tldr -u

Can you check if that changes things for you ?

@psibi After this, ./tldr doesn't find pages, and ./tldr -u segfaults again

The straces look very similar as well

Jonta commented 1 year ago

tldr --version 0.9.2

psibi commented 1 year ago

Nice, thanks for the confirmation.