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 Zsh Completion Script Generation and Unit Tests #1182

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

954alberto
Copy link

Summary: This PR introduces enhancements to the cargo-make tool by adding task completion script generation functionality per shell. Key updates include, in this case only Zsh was added:

Directory and File Management:

Automatically creates the ~/.zfunc directory if it does not exist.
Prompts users before overwriting the completion file if it already exists.
User Guidance:

Outputs clear instructions for enabling Zsh completions by modifying the ~/.zshrc file.
Testing Improvements:

Added unit tests for the completion generation function, including tests for user input handling and file creation.
Tests have been designed to clean up the test environment to avoid interference between test cases.

Ensures that the functionality can be tested without manually interacting with the terminal.

Copy link
Owner

@sagiegurari sagiegurari left a comment

Choose a reason for hiding this comment

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

@954alberto this is great (sorry for late review).
would you mind also adding the relevant docs for this?
do it in the nav+content md files and not README.md which is generated from them.

src/lib/cli_parser.rs Outdated Show resolved Hide resolved
src/lib/completion.rs Outdated Show resolved Hide resolved
src/lib/completion.rs Outdated Show resolved Hide resolved
src/lib/completion.rs Outdated Show resolved Hide resolved
src/lib/completion_test.rs Outdated Show resolved Hide resolved
src/lib/completion_test.rs Show resolved Hide resolved
Copy link
Author

@954alberto 954alberto left a comment

Choose a reason for hiding this comment

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

Please take a look, it should be better now

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.

2 participants