From ea1b19f7b08b2e1b9f7ba9d4c3de6607f44c6a5f Mon Sep 17 00:00:00 2001 From: harveyshao Date: Mon, 17 Jan 2022 17:59:36 +0800 Subject: [PATCH] add grep --- base/nfs/grep.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 base/nfs/grep.go diff --git a/base/nfs/grep.go b/base/nfs/grep.go new file mode 100644 index 00000000..92ec1512 --- /dev/null +++ b/base/nfs/grep.go @@ -0,0 +1,14 @@ +package nfs + +import ice "shylinux.com/x/icebergs" + +const GREP = "grep" + +func init() { + Index.Merge(&ice.Context{Commands: map[string]*ice.Command{ + GREP: {Name: "grep path word auto", Help: "搜索", Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) { + m.Option("cmd_dir", arg[0]) + m.Split(m.Cmdx("cli.system", GREP, "--exclude=.[a-z]*", "--exclude-dir=.[a-z]*", "-rni", arg[1]), "file:line:text", ":") + }}, + }}) +}