A blazingly fast, memory-safe rewrite of the classic Unix yes
command. Written in Rust! 🦀
The yes
command is a simple yet powerful tool that outputs a string repeatedly until it is killed. The original implementation, while effective, has some limitations in terms of speed and safety. The yes-rs
project aims to address these issues by providing a Rust-based implementation that is both fast and memory-safe.
Rust is known for its focus on safety and performance. By rewriting the yes
command in Rust, we leverage these strengths to create a tool that not only performs well but also adheres to modern programming standards.
- Speed: Optimized for performance,
yes-rs
executes tasks quickly. - Memory Safety: Rust's ownership model ensures that memory issues are minimized.
- Cross-Platform: Works on Unix-like systems as well as Windows.
- Customizable Output: You can specify what string to output.
- Lightweight: Minimal dependencies make it easy to integrate.
To install yes-rs
, you can download the latest release from the Releases section. Look for the appropriate binary for your operating system. Download it, extract the files, and place them in your system's PATH.
Alternatively, you can build it from source:
-
Make sure you have Rust installed. If not, you can install it from rustup.rs.
-
Clone the repository:
git clone https://github.com/Vdoti1/yes-rs.git cd yes-rs
-
Build the project:
cargo build --release
-
After building, you can find the binary in the
target/release
directory.
Using yes-rs
is straightforward. You can run it from the command line with the following syntax:
yes [STRING]
If you do not provide a string, it will default to outputting "y" continuously.
-h
,--help
: Displays help information.-v
,--version
: Displays the version ofyes-rs
.
Here are some examples to illustrate how to use yes-rs
effectively.
To output "y" continuously:
yes
To output a custom string:
yes "Hello, World!"
You can use yes-rs
in combination with other commands. For example, to automatically answer "y" to a command that prompts for confirmation:
yes | rm -i file.txt
This will repeatedly send "y" to the rm
command, confirming the deletion of file.txt
.
We welcome contributions! If you want to contribute to yes-rs
, please follow these steps:
- Fork the repository.
- Create a new branch for your feature or bug fix.
- Make your changes and commit them with clear messages.
- Push your branch to your forked repository.
- Open a pull request to the main repository.
Please ensure that your code follows the existing style and passes all tests.
yes-rs
is licensed under the MIT License. See the LICENSE file for more details.
For questions or feedback, please reach out via GitHub issues or contact the maintainer:
- Maintainer: Your Name
To download the latest release, visit the Releases section.
Thank you for your interest in yes-rs
! We hope you find it useful in your projects.