用zsh扩展命令行排除模式 [英] Expand command line exclude pattern with zsh

查看:157
本文介绍了用zsh扩展命令行排除模式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图通过一个复杂的正则表达式作为忽略模式。我想忽略 locales / locales / US / en / * 以外的所有子文件夹。 。我可能需要使用.agignore文件,但我试图避免这种情况。

I'm trying to pass a complicated regex as an ignore pattern. I want to ignore all subfolders of locales/ except locales/US/en/*. I may need to fallback to using a .agignore file, but I'm trying to avoid that.

我使用银色搜索器(类似于Ack,Grep)。我在终端中使用了zsh。

I'm using silver searcher (similar to Ack, Grep). I use zsh in my terminal.

这很好,忽略了除 locales / US 以外的所有语言环境子文件夹。 code>:

This works really well and ignores all locale subfolders except locales/US:

ag -g "" --ignore locales/^US/ | fzf

我也想忽略所有 locales / US / * locales / US / en
外我想要的是这个,但它不起作用。

I also want to ignore all locales/US/* except for locales/US/en Want I want is this, but it does not work.

ag -g "" --ignore locales/^US/^en | fzf

想法?

推荐答案

添加多个--ignore命令。例如:

Add multiple --ignore commands. For instance:

ag -g "" --ignore locales/^US/ --ignore locales/US/^en

这篇关于用zsh扩展命令行排除模式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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