superwhich
superwhich is a cross-platform CLI tool and library that was initially meant to be a faster drop-in replacement for Windows' where command but since it uses Jaro-Winkler distance to calculate the similarity between the strings it can be called a sort of "smart" which, it can handle some typos and highlights the section of the executables that matches the search pattern.
Installation
CLI
- From crates.io:
cargo install superwhich - From GitHub:
cargo install --git https://github.com/DarkCeptor44/superwhich - Manually (after cloning the repo locally):
cargo install --path . - From releases.
Library
Or you can add this to your Cargo.toml file:
[]
= "^2"
Usage

<PATTERN> The
)
)
Todo
- Make it faster (currently at
~221mson Windows). - Find a better way to match the pattern to the name when printing the result so it highlights similar strings as well.
Tests
You can run the tests with cargo test.
Benchmarks
Library
The library benchmarks can be ran with cargo bench.
| Benchmark | Min Mean Max | Outliers |
|---|---|---|
find_executables/fake binaries |
73.288 µs 73.486 µs 73.725 µs | 4 (4.00%) high mild, 6 (6.00%) high severe |
find_executables/real PATH |
210.48 ms 211.14 ms 211.84 ms | 4 (4.00%) high mild, 1 (1.00%) high severe |
highlight_text |
1.4787 µs 1.4829 µs 1.4872 µs | 2 (2.00%) low mild, 1 (1.00%) high mild, 3 (3.00%) high severe |
CLI
The CLI was benchmarked using Hyperfine.
Windows
- AMD64, 32GB RAM, Ryzen 7 3800X, Windows 10.
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
where pnpm |
94.7 ± 1.1 | 93.5 | 98.7 | 1.00 |
swhich pnpm |
221.8 ± 3.5 | 215.7 | 229.2 | 2.34 ± 0.05 |
Linux
- ARM64, 1GB RAM, Orange Pi Zero2, Debian 12.
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
which lookfor |
3.0 ± 0.2 | 2.6 | 4.7 | 1.00 |
swhich lookfor |
17.6 ± 0.3 | 17.0 | 19.8 | 5.93 ± 0.43 |
License
This project is licensed under the terms of the GNU General Public License v3.0.