https://github.com/insomnimus/wh
A 'which' tool replacement written in rust.
https://github.com/insomnimus/wh
cli coreutils rust which
Last synced: about 1 year ago
JSON representation
A 'which' tool replacement written in rust.
- Host: GitHub
- URL: https://github.com/insomnimus/wh
- Owner: insomnimus
- License: mit
- Created: 2021-05-04T16:36:18.000Z (about 5 years ago)
- Default Branch: main
- Last Pushed: 2024-04-20T15:37:14.000Z (about 2 years ago)
- Last Synced: 2025-02-06T14:58:10.863Z (over 1 year ago)
- Topics: cli, coreutils, rust, which
- Language: Rust
- Homepage:
- Size: 113 KB
- Stars: 1
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: LICENSE
Awesome Lists containing this project
README
# wh
A `which` replacement.
## Features
- On Windows: Check for missing extensions from the `PATHEXT` environment variable as well as `.exe`
- Linux style globbing support.
- On non-Windows: Read function and alias definitions from stdin just like GNU which.
- On non-Windows: Mostly a superset of GNU which.
## Installation
### Installation On Windows Via [Scoop](https://github.com/ScoopInstaller/Scoop)
This way you can update wh with scoop.
1. Add my [personal bucket](https://github.com/insomnimus/scoop-bucket) to Scoop.\
`scoop bucket add insomnia https://github.com/insomnimus/scoop-bucket`
2. Update scoop.\
`scoop update`
3. Install wh.\
`scoop install wh`
### Other Methods
Download a binary for your platform from [the releases page](releases/)
Or build it from source:
```sh
cargo install --locked --branch main --git https://github.com/insomnimus/wh
```
### Suggested Usage On Non-Windows Platforms
You might want to add a shell function in your profile so that `wh` can read your aliases and functions:
```shell
wh() {
{
alias
declare -f
} | /usr/bin/wh --read-alias --read-functions "$@"
}
```
Don't forget to change `/usr/bin/wh` with the full path of `wh` on your system.
## Shell Completions
Currently there are hand-written tab completions for Powershell.
You can get it by running `wh --completions powershell`.
Register it by saving the output into a `.ps1` file and then running the script.
If you want to have it be loaded automatically, add it to your Powershell profile.