自制软件可轻松获得公式列表 [英] Homebrew get list of formulas in a tap

查看:70
本文介绍了自制软件可轻松获得公式列表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何(通过命令行)从自制软件中轻按一下即可获取公式列表.
运行brew tap仅列出该水龙头,而不列出该水龙头中存在的公式.

How would I (through the command line) get the list of formulas in a tap from homebrew.
Running brew tap only list the tap but not the formulas that exist as part of that tap.

如果不存在这样的命令,如何以编程方式检索公式列表.

If such a command doesn't exist, how can I programmatically retrieve the list of formulas.

推荐答案

水龙头中的公式列表显示在brew tap-info $TAP --json中.

The list of formulas in a tap is exposed in brew tap-info $TAP --json.

从这里,您可以使用JSON命令行解析器提取列表,例如 jq :

From here, you can use a JSON command line parser to extract the list, such as jq:

例如,列出homebrew/cask-fonts和kde-mac/kde中的所有公式:

For example, to list all the formulas from homebrew/cask-fonts and kde-mac/kde:

brew tap-info homebrew/cask-fonts kde-mac/kde --json | jq -r '.[]|(.formula_names[],.cask_tokens[])'

这篇关于自制软件可轻松获得公式列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆