Skip to content

insomnimus/wh

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

66 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

This way you can update wh with scoop.

  1. Add my personal 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

Or build it from source:

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:

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.