https://github.com/technodelight/php-fuse-cli
Use loilo/fuse php lib in CLI
https://github.com/technodelight/php-fuse-cli
cli fuzzy-search php
Last synced: 7 months ago
JSON representation
Use loilo/fuse php lib in CLI
- Host: GitHub
- URL: https://github.com/technodelight/php-fuse-cli
- Owner: technodelight
- License: mit
- Created: 2019-08-29T09:28:09.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2019-08-29T13:01:24.000Z (almost 7 years ago)
- Last Synced: 2024-12-28T17:27:56.720Z (over 1 year ago)
- Topics: cli, fuzzy-search, php
- Language: PHP
- Homepage:
- Size: 9.77 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: LICENSE
Awesome Lists containing this project
README
## about
This script is a simple filtering solution for command line, as I haven't found
anything similar with 5 min googleing. Reads from `stdin`, outputs to `stdout`.
Errors will be printed to `stderr`.
## install
```bash
$ composer global require technodelight/fuse-cli
```
## usage
Filter lists simply.
```bash
$ echo -e "house\ntrance\ntechno" | fuse ho
# // this puts the following to stdout:
# house
# techno
```
options:
- `-q`: quiet mode (exit 0 on match, exit 1 on no match)
```bash
echo -e "house\ntrance\ntechno" | fuse trz -q && echo yep || echo nope # outputs: yep
```
- `-t[float]`: set threshold (defaults to 0.4 for a more exact match)
```bash
echo -e "house\ntrance\ntechno" | fuse trz # outputs: trance
echo -e "house\ntrance\ntechno" | fuse trz -t0.8 # outputs: trance, techno
```