technodelight/fuse-cli

此软件包最新版本(dev-master)没有可用的许可证信息。

在命令行中使用loilo/fuse php 库

dev-master 2019-08-29 13:01 UTC

This package is auto-updated.

Last update: 2024-08-29 05:58:42 UTC


README

该脚本是一个简单的命令行过滤解决方案,因为我没有在5分钟的谷歌搜索中找到类似的东西。从stdin读取,输出到stdout。错误将打印到stderr

安装

$ composer global require technodelight/fuse-cli

用法

简单地过滤列表。

$ echo -e "house\ntrance\ntechno" | fuse ho 
# // this puts the following to stdout: 
# house
# techno

选项

  • -q:安静模式(匹配时退出0,不匹配时退出1)
echo -e "house\ntrance\ntechno" | fuse trz -q && echo yep || echo nope # outputs: yep 
  • -t[float]:设置阈值(默认为0.4,以便更精确的匹配)
echo -e "house\ntrance\ntechno" | fuse trz # outputs: trance
echo -e "house\ntrance\ntechno" | fuse trz -t0.8 # outputs: trance, techno