| Crates.io | rustscrub |
| lib.rs | rustscrub |
| version | 0.1.0 |
| created_at | 2025-05-21 13:43:56.49499+00 |
| updated_at | 2025-05-21 13:43:56.49499+00 |
| description | A CLI tool for scrubbing sensitive data from files. |
| homepage | https://schwaberow.de |
| repository | https://github.com/vschwaberow/rustscrub |
| max_upload_size | |
| id | 1683397 |
| size | 48,763 |
A CLI tool for scrubbing sensitive data from files.
A CLI tool for scrubbing sensitive data from files.
Version: 0.1.0 Author: volker schwaberow volker@schwaberow.de Homepage: https://schwaberow.de Repository: https://github.com/vschwaberow/rustscrub
rustscrub is a command-line interface (CLI) tool built with Rust, designed to remove comments from source code files. This can be useful for preparing code for distribution, reducing file size, or cleaning up codebases.
The tool focuses on identifying and stripping out comment blocks and lines. It is particularly useful for developers who want to share their code without exposing comments that may contain sensitive information, such as TODOs, internal notes, or any other non-essential information.
Clone the repository:
git clone https://github.com/vschwaberow/rustscrub.git
cd rustscrub
Build the project:
cargo build
For a release build (optimized):
cargo build --release
The executable will be located at target/debug/rustscrub or target/release/rustscrub.
(Optional) Install the binary to a directory in your PATH:
cp target/release/rustscrub ~/.local/bin/ # Adjust path as needed, e.g., /usr/local/bin
Once the crate is published to crates.io, you will be able to install it using:
cargo install rustscrub
The primary way to use rustscrub is by providing an input file. The processed output can either be directed to an output file or, if no output file is specified, it might print to standard output (this behavior should be clarified as development progresses).
Basic syntax:
rustscrub <input_file_path> [OPTIONS]
Arguments:
<input_file_path>: (Required) The path to the file that needs to be processed.Options:
-o, --output <output_file_path>: Specifies the path for the output file. If not provided, the behavior might be to print to standard output.-H, --header-lines <number>: Specifies the number of header lines to preserve from the input file. Defaults to 0.-v, --verbose: Enables verbose output, providing more details about the scrubbing process.-d, --dry-run: Performs a dry run. It will show what would be changed without actually modifying any files or producing an output file.--help: Displays a help message with all available commands and options.Examples:
Scrub comments from source.rs and save the result to scrubbed_source.rs:
rustscrub source.rs -o scrubbed_source.rs
Scrub comments from main.rs, preserving the first 5 header lines, and show verbose output:
rustscrub main.rs -H 5 -v -o cleaned_main.rs
Perform a dry run on utils.rs to see what would be scrubbed:
rustscrub utils.rs -d
Display help information:
rustscrub --help
This project uses clap for command-line argument parsing.
[dependencies]
clap = { version = "4.4.8", features = ["derive"] }
cargo test
It's recommended to use rustfmt for formatting and clippy for linting.
cargo fmt
cargo clippy
Contributions are welcome! If you have an idea for a new feature, a bug fix, or improvements to the documentation, please feel free to:
git checkout -b feature/your-feature-name).git commit -am 'Add some feature').git push origin feature/your-feature-name).Please ensure your code adheres to the existing style and that all tests pass.
This project is licensed under the MIT License. See the LICENSE file for more details.
(You will need to create a LICENSE file containing the text of the MIT license).
cli, rust, scrub, security, privacy, data sanitization
Command-line utilities
Clone the repository:
git clone https://github.com/vschwaberow/rustscrub.git
cd rustscrub
Build the project:
cargo build
For a release build (optimized):
cargo build --release
The executable will be located at target/debug/rustscrub or target/release/rustscrub.
(Optional) Install the binary to a directory in your PATH:
cp target/release/rustscrub ~/.local/bin/ # Adjust path as needed, e.g., /usr/local/bin
Once the crate is published to crates.io, you will be able to install it using:
cargo install rustscrub
The primary way to use rustscrub is by providing an input file. The processed output can either be directed to an output file or, if no output file is specified, it might print to standard output (this behavior should be clarified as development progresses).
Basic syntax:
rustscrub <input_file_path> [OPTIONS]
Arguments:
<input_file_path>: (Required) The path to the file that needs to be processed.Options:
-o, --output <output_file_path>: Specifies the path for the output file. If not provided, the behavior might be to print to standard output.-H, --header-lines <number>: Specifies the number of header lines to preserve from the input file. Defaults to 0.-v, --verbose: Enables verbose output, providing more details about the scrubbing process.-d, --dry-run: Performs a dry run. It will show what would be changed without actually modifying any files or producing an output file.--help: Displays a help message with all available commands and options.Examples:
Scrub comments from source.rs and save the result to scrubbed_source.rs:
rustscrub source.rs -o scrubbed_source.rs
Scrub comments from main.rs, preserving the first 5 header lines, and show verbose output:
rustscrub main.rs -H 5 -v -o cleaned_main.rs
Perform a dry run on utils.rs to see what would be scrubbed:
rustscrub utils.rs -d
Display help information:
rustscrub --help
This project uses clap for command-line argument parsing.
[dependencies]
clap = { version = "4.4.8", features = ["derive"] }
cargo test
It's recommended to use rustfmt for formatting and clippy for linting.
cargo fmt
cargo clippy
Contributions are welcome! If you have an idea for a new feature, a bug fix, or improvements to the documentation, please feel free to:
git checkout -b feature/your-feature-name).git commit -am 'Add some feature').git push origin feature/your-feature-name).Please ensure your code adheres to the existing style and that all tests pass.
This project is licensed under the MIT License. See the LICENSE file for more details.
(You will need to create a LICENSE file containing the text of the MIT license).
cli, rust, scrub, security, privacy, data sanitization
Command-line utilities