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

feat: add completion command #442

Merged
merged 7 commits into from
Oct 25, 2024
Merged

Conversation

Zamoca42
Copy link
Contributor

Description

I've implemented the auto-completion feature suggested in roadmap issue #342.

A new completion.js file was created to generate and install auto-completion scripts for both bash and zsh shells. I've also added a completion command to bin/tldr.

Images showing the feature in action are attached.

Details

  • Added completion.js to handle completion script generation and installation
  • Updated bin/tldr to include a new completion command
  • Supports both bash and zsh shells
  • Automatically adds completion scripts to the user's shell configuration file

I hope this feature makes using tldr even more convenient.

zsh

zsh-test

bash

bash-test

Checklist

Please review this checklist before submitting a pull request.

  • Code compiles correctly
  • Created tests, if possible
  • All tests passing (npm run test:all)
  • Extended the README / documentation, if necessary

Related

Closes #342

@Zamoca42

This comment was marked as off-topic.

@kbdharun kbdharun requested a review from sbrl August 21, 2024 06:30
- Replace hardcoded paths with `os.homedir()` and `path.join()`
- Ensure tests run consistently across different operating systems
bin/tldr Outdated Show resolved Hide resolved
Copy link
Member

@renie renie left a comment

Choose a reason for hiding this comment

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

Just a small consideration on README.
The code itself LGTM. I will run a couple of tests on this branch just to be sure, and comment here as soon as it is all checked.
Thanks for the contribution, @Zamoca42 ! 🥇

README.md Outdated Show resolved Hide resolved
@renie
Copy link
Member

renie commented Oct 24, 2024

It works like a charm, @Zamoca42 ! Thanks a lot! 🔥
Just have a look at the change requested, please.

Copy link
Member

@renie renie left a comment

Choose a reason for hiding this comment

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

All good now!

Copy link
Member

@kbdharun kbdharun left a comment

Choose a reason for hiding this comment

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

LGTM, Thanks for your contribution. If possible, can you revert the oh my zsh plugin section beside the new zsh docs (the zplug one isn't required) since it allows using the commands with shortcuts?

@Zamoca42
Copy link
Contributor Author

@kbdharun I have reverted the oh-my-zsh plugin section in README!
Let me know if there are any other changes needed. 😄

@renie renie merged commit daff603 into tldr-pages:main Oct 25, 2024
9 checks passed
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.

Move completion files to the right directory when installing tldr
4 participants