Skip to content

The -p option does not have the alias function #15382

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

Closed
witt-bit opened this issue Dec 30, 2024 · 3 comments · Fixed by #15392
Closed

The -p option does not have the alias function #15382

witt-bit opened this issue Dec 30, 2024 · 3 comments · Fixed by #15392

Comments

@witt-bit
Copy link
Collaborator

tldr -p linux awk output :

$ tldr -p linux awk                                                                                                  ✔ 
`awk` documentation is not available.
If you want to contribute it, feel free to send a pull request to: https://github.com/tldr-pages/tldr

tldr awk output :

$ tldr awk                                                                                                         1 ✘ 

  awk

  一种用于文件处理的通用编程语言。
  更多信息:https://github.com/onetrueawk/awk.

  - 以空格为分隔符,打印文件每行第五列(也称作字段):
    awk '{print $5}' 文件名

  - 以空格为分隔符,打印文件包含“foo” 的所有行的第二列:
    awk '/foo/ {print $2}' 文件名

  - 以逗号而不是空格作为分隔符,打印文件每行的最后一列:
    awk -F ',' '{print $NF}' 文件名

  - 计算文件的第一列数值之和并打印:
    awk '{s+=$1} END {print s}' 文件名

  - 从第一行开始,每三行打印一行:
    awk 'NR%3==1' 文件名

  - 根据条件不同,打印不同内容:
    awk '{if ($1 == "foo") print "Exact match foo"; else if ($1 ~ "bar") print "Partial match bar"; else print "Baz"}' 文件名

  - 打印第 10 列等于指定值的所有行:
    awk '($10 == 指定值)'

  - 打印第 10 列介于最小值和最大值之间的所有行:
    awk '($10 >= 最小值 && $10 <= 最大值)'

The awk command is located in common/awk.md and should work on any platform (linux, macos, etc.), at least no matter what the -p option is, you should get the documented results.


The reason why I have this problem is that I execute the command tldr gawk and the output is

$ tldr gawk                                                                                                          ✔ 

  gawk

  这是 `-p linux awk` 命令的一个别名。

  - 原命令的文档在:
    tldr -p linux awk

Found 2 pages with the same name under the platforms: osx, osx.

Leads me to execute tldr -p linux awk,After I executed it, the following prompts

$ tldr -p linux awk                                                                                                  ✔ 
`awk` documentation is not available.
If you want to contribute it, feel free to send a pull request to: https://github.com/tldr-pages/tldr

I think this is ill-designed!

@gutjuri
Copy link
Member

gutjuri commented Dec 30, 2024

Which tldr client are you using (aka how did you install tldr?). Sounds like a bug in the client. I interpret the client specification (https://github.com/tldr-pages/tldr/blob/main/CLIENT-SPECIFICATION.md#page-resolution) as requiring that a page should be displayed when it exists for any platform, even when the desired platform is specified through the -p parameter.

@witt-bit
Copy link
Collaborator Author

OS: Manjaro 24.2.1 Yonada, and install tldr using the command sudo pacman -S tldr, I understand your description, but I think this may be a more usable optimization point.

@acuteenvy
Copy link
Member

It is a bug in the client, but the gawk page is wrong too. There is no page for awk in the linux directory.

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 a pull request may close this issue.

3 participants