r-unruh / mtracker

cli movie tracker written in Rust - keep track of watched movies and series
MIT License
4 stars 1 forks source link

Add completion files for bash and zsh #3

Open aartoni opened 1 day ago

aartoni commented 1 day ago

No more typing full movie names to rate or manage your collection! This PR introduces intelligent autocompletion for mtracker commands, providing suggestions based on context. Here's a breakdown of the new autocomplete behaviors:

Testing

Source the appropriate shell completion script (completions/zsh or completions/bash) and use tab completion on mtracker subcommands to verify suggestions are working as described.

Limitations

Bash lacks built-in support for displaying detailed argument descriptions and for suggesting strings that contain spaces. As a result, Bash completion is limited to simpler cases without complex suggestions.

r-unruh commented 13 hours ago

Thanks! This is very interesting and I like it so far.

A few things to fix:

By the way, have you seen clap_complete? I've not looked into it yet, but it might bring interesting things to the table.

aartoni commented 12 hours ago

You're definitely right on all three points, I've committed the changes. I didn't know about clap_complete and I'd be more than happy to add it to the project to avoid having to update these files manually.

Should we get this merged and create an issue for clap_complete? I won't be able to work on clap_complete today but I might be this weekend or next week.