7 releases (4 breaking)
Uses new Rust 2024
| 0.6.1 | Oct 30, 2025 |
|---|---|
| 0.6.0 | Feb 25, 2025 |
| 0.5.0 | Oct 13, 2022 |
| 0.4.0 | Feb 25, 2021 |
| 0.2.1 | Oct 25, 2017 |
#281 in Command-line interface
Used in doq
23KB
459 lines
close_enough
Simple fuzzy-searching function and command line tool.
Installation
cargo install close_enough
Installing the ce command
This is a cd-like command for fuzzily changing directories. See examples further down.
- Install
close_enoughas above - Run
cle -ce-script bash > ce.shto generate the shell script- If you also want to use the
hopcommand, you should use:cle -ce-script bash --with-hop > ce.sh
- If you also want to use the
- Source
ce.shin your.bashrc,.profile, or similar
Installing the hop command
This allows you to track recently used folders (you can define wrappers around cd or ce to do this automatically) and hop directly to them with a fuzzy match.
- Install
close_enoughas above - Run
cle -hop-script bash > hop.shto generate the shell script - Source
hop.shin your.bashrcetc.
Usage
cle
~$ cle duck --inputs blue_and_gold_macaw duck_billed_platypus angry_dog
> duck_billed_platypus
~$ cle dbp --inputs blue_and_gold_macaw duck_billed_platypus angry_dog
> duck_billed_platypus
~$ ls
> my_file.txt their_file.txt your_file.txt
~$ ls | cle my
> my_file.txt
ce
~$ ce my lo dir pa
~/my/long/directory/path$
~/my/long/directory/path$ ce ..
~/my/long/directory$
~/my/long/directory/path$ ce ..3
~/my$
~/my/long/directory/path$ ce ..my other dir pa
~/my/other/directory/path$
~$ ce / u lo sh
/usr/local/share$ ce ~
~$
hop
~$ ce my dir 1
~/my/directories/d1$ ce .. 2
~/my/directories/d2$ cd
~$ # If you used --with-hop then hop will have tracked the d1 and d2 dirs
~$ hop to d1
~/my/directories/d1$ hop to d2
~/my/directories/d2$
Dependencies
~3.5–7.5MB
~132K SLoC