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

Make list option display comply with official spec #112

Merged
merged 1 commit into from
Apr 16, 2020

Conversation

michaeldel
Copy link
Contributor

TL;DR make commands list display write one item per line instead of comma-separated items.

Tealdeer currently displays command list comma-separated, e.g.

$ tldr --list
bar, baz, foo, qux

Whereas the official TLDR specification states the following

Additional decoration MAY be printed if the standard output is a TTY. If not, then the output MUST not contain any additional decorations. For example a page list MUST be formatted with 1 page name per line (to enable easy manipulation using standard CLI tools such as grep etc.).

e.g.

$ tldr --list
bar
baz
foo
qux

Adding TTY-specific decorated output goes against KISS principle in my opinion. On top of that, even considering adding metadata to items display (like some kind of version or tags or anything) still makes non-line-wise display pretty undesirable for every use case I can think about.

Copy link
Collaborator

@dbrgn dbrgn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, it makes sense to stick to the spec (and I agree about the decorations). If I remember correctly, the current behavior with comma-separated page names is simply what the node client used to do a few years back.

@dbrgn dbrgn merged commit 5dd9457 into tealdeer-rs:master Apr 16, 2020
dbrgn pushed a commit that referenced this pull request Mar 21, 2021
…extra _files args (#168)

- Use array `commands=(...)` and `_describe` to deal with '[.md' & empty cache scenario.  Fixes #166
- Hide `tldr --list` stderr (`2>/dev/null`) which breaks completion with empty cache
- Remove `sed` since #112 changed commas to newlines
- Add new `sed`-equivalent replacement (`:` -> `\:`) using native [ZSH `${name//pattern/repl}`](http://zsh.sourceforge.net/Doc/Release/Expansion.html#Parameter-Expansion) since colon is special character in ZSH completions
- Add basic support for `-L, --language` flag from #125. In future, can consider adding extra completions maybe based on caches `pages.{lang}` folders.
- Remove extraneous completion of file names for positional arguments (i.e. `'*:file:_files'`)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants