superwhich

Crates.iosuperwhich
lib.rssuperwhich
version1.0.1
sourcesrc
created_at2024-11-04 17:04:25.143596
updated_at2024-11-04 17:54:35.718064
descriptionCross-platform smart which alternative
homepagehttps://github.com/DarkCeptor44/superwhich
repositoryhttps://github.com/DarkCeptor44/superwhich
max_upload_size
id1435323
size61,136
Murilo Pagliuso (DarkCeptor44)

documentation

README

superwhich

superwhich is a cross-platform CLI tool 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

  • 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.

Usage

usage

$ swhich -h
Cross-platform smart which alternative

Usage: swhich [OPTIONS] <PATTERN>

Arguments:
  <PATTERN>  The search pattern

Options:
  -c, --color <COLOR>  Color of the highlighted text (off for no color) [default: blue]
  -t, --print-time     Print time elapsed
  -h, --help           Print help
  -V, --version        Print version

Todo

  • Make it faster (currently at ~270ms).
  • Find a better way to match the pattern to the name when printing the result.

Benchmarks

The benchmarks were run using Hyperfine.

Machine A

  • AMD64, 32GB RAM, Ryzen 7 3800X, Windows 10.
Command Mean [ms] Min [ms] Max [ms] Relative
swhich pnpm 274.3 ± 4.0 264.7 279.0 2.55 ± 0.09
where pnpm 107.6 ± 3.7 104.2 119.9 1.00

Machine B

  • ARM64, 1GB RAM, Orange Pi Zero2, Debian 12.

coming soon

License

This project is licensed under the terms of the GNU General Public License v3.0.

Commit count: 4

cargo fmt