Crates.io | dev_bestia_cargo_completion |
lib.rs | dev_bestia_cargo_completion |
version | 2024.421.1905 |
source | src |
created_at | 2021-08-17 12:08:23.222137 |
updated_at | 2024-04-21 19:07:45.043716 |
description | Auto-completion for cargo-auto and automation_tasks_rs and partial auto-completion for cargo in bash |
homepage | https://bestia.dev |
repository | https://github.com/automation-tasks-rs/dev_bestia_cargo_completion |
max_upload_size | |
id | 438420 |
size | 27,063 |
Auto-completion for cargo-auto and automation_tasks_rs and partial auto-completion for cargo in bash
version: 2024.421.1905 date: 2024-04-21 author: bestia.dev repository: GitHub
dev_bestia_cargo_completion is part of the automation_tasks_rs project
Hashtags: #maintained #ready-for-use #rustlang #automation #workflow
My projects on GitHub are more like a tutorial than a finished product: bestia-dev tutorials.
I recommend using the CRUSTDE - Containerized Rust Development Environment to write Rust projects on Linux, isolated from your system.
Install the binary:
cargo install dev_bestia_cargo_completion
Save definition for auto_completion in bash:
complete -C "dev_bestia_cargo_completion" cargo
Start typing cargo b
and press tab
.
It should auto-complete to cargo build
.
Congratulation! You just used auto-completion :-)
Auto-completion in Debian bash is a great tool. You type the first letters, press tab and the word is auto-completed.
Bash can call an executable binary to return the available words. So it can be written in Rust. This can produce even better results as known as dynamic auto-completion
.
For my knowledge cargo
does not have auto-completion yet. There are many plans. It can take some time.
I will build what I need now. Something simple. It doesn't need to be perfect.
This is a great blog:
https://www.joshmcguigan.com/blog/shell-completions-pure-rust/
The Linux command complete
adds auto_completion definitions to bash.
But it is only for the current session. If you want to make it persistent add it to the ~/.bashrc
file.
# list the definitions
complete
# delete a definition
complete -r cargo
# define a binary to auto-complete the command
complete -C "binary" command
# for example
complete -C "dev_bestia_cargo_completion" cargo
Read the development details in a separate md file:
DEVELOPMENT.md
Read the changelog in a separate md file:
RELEASES.md
Nothing big in the near future.
My open-source projects are free as a beer (MIT license).
I just love programming.
But I need also to drink. If you find my projects and tutorials helpful, please buy me a beer by donating to my PayPal.
You know the price of a beer in your local bar ;-)
So I can drink a free beer for your health :-)
Na zdravje! Alla salute! Prost! Nazdravlje! 🍻
//bestia.dev
//github.com/bestia-dev
//bestiadev.substack.com
//youtube.com/@bestia-dev-tutorials