๐บโRunโโ
Run is a command-line tool that executes commands in multiple directories
concurrently.
Bench
๐ Installation
๐ ๏ธ Usage
Run can be used with various options:
<PATTERN> ๐โ
This command will fetch from upstream for all .git repositories inside the
current directory. It essentially replaces the following command:
Options
--Command or -C:
The command to execute:
or multiple commands:
--File or -F:
Limit execution to files matching a certain pattern:
--Root or -R:
Set the current working directory to a different folder (default is .):
--Parallel or -P:
Run commands in parallel (default is sequential):
--Exclude:
Exclude certain files or directories (defailt is
node_modules .git target dist vendor)
--Pattern:
Specify a custom pattern for matching
Dependencies
Run relies on several Rust crates to provide its functionality:
-
clap (v4.5.17) - A powerful and flexible command-line argument parser. The "derive" feature is used to simplify the creation of command-line interfaces through derive macros.
-
walkdir (v2.5.0) - Provides an efficient and cross-platform way to recursively traverse directories. This is useful for filesystem operations and searching.
-
futures (v0.3.30) - Offers abstractions for asynchronous programming in Rust. It's used in conjunction with tokio to handle asynchronous operations effectively.
-
rayon (v1.10.0) - Enables easy parallelism for data-parallel tasks. It's used to parallelize CPU-bound operations, improving performance on multi-core systems.
-
tokio (v1.40.0) - An asynchronous runtime for Rust, providing essential building blocks for writing reliable asynchronous applications. The "full" feature set is used to enable all tokio functionality.
-
num_cpus (v1.16.0) - A small crate that determines the number of CPUs on the current system. This is useful for optimizing parallel workloads.
-
once_cell (v1.19.0) - Provides a way to perform lazy static initialization. It's often used for global variables or singletons that need to be initialized only once.
These dependencies work together to provide a robust, efficient, and user-friendly command-line tool capable of handling parallel and asynchronous operations while efficiently traversing filesystems.
Changelog
See CHANGELOG.md for a history of changes to this CLI.