#shell #command-output #command #execute-command

bin+lib commandcrafter

This crate is used to execute shell commands using rust convenience

9 releases

0.4.2 Apr 13, 2024
0.4.1 Apr 12, 2024
0.3.3 Mar 20, 2024
0.3.2 Feb 27, 2024
0.2.2 Feb 17, 2024

#681 in Development tools

Download history 236/week @ 2024-02-11 202/week @ 2024-02-18 164/week @ 2024-02-25 10/week @ 2024-03-03 33/week @ 2024-03-10 123/week @ 2024-03-17 3/week @ 2024-03-24 5/week @ 2024-03-31 254/week @ 2024-04-07 144/week @ 2024-04-14

414 downloads per month

MIT license

25KB
273 lines

CommandCrafter

CommandCrafter is a Rust crate designed to simplify interaction with the console and facilitate the creation of automated programs. It provides a convenient interface for executing commands and capturing their output. Additionally, it offers functionality to write this output to a file, enabling easy logging and further processing

Features

  • Execute commands from within Rust programs.
  • Capture command output.
  • Write command output to a file for logging and analysis.
  • Display the output command in the terminal.
  • Simplify automation tasks by leveraging Rust's capabilities.
  • Store the output in a file within the log folder on the desktop.
  • The processing now is colorized for easy reading.
  • The progress of program running displayed in a colorized way.
  • log the output with folder log in Desktop with spacific /filename.log

Installation

Add this crate to your Cargo.toml file:

cargo add commandcrafter

Example

for normal use check this example:

use commandcrafter::execute::Execute;

fn main() {
    let output = Execute::run("du", &["-h", "--max-depth=1", "."]);
    Execute::print_into_console(output);
}

for more Usage check docs

Contributing

Contributions are welcome! If you encounter any issues or have suggestions for improvements, feel free to open an issue or submit a pull request on GitHub.

No runtime deps