feat(commands): refactor and add more commands

This commit is contained in:
verse91
2026-04-09 23:30:16 +07:00
parent 76458ce52e
commit f4816d2b5f
31 changed files with 546 additions and 110 deletions
+19
View File
@@ -0,0 +1,19 @@
package search
import (
"github.com/versenilvis/iris/commands/core"
)
func init() {
core.Register(&core.Spec{
Name: "find",
Description: "search for files",
Generator: core.FileGenerator("/"),
Options: []core.Option{
{Name: "-name", Description: "match by name"},
{Name: "-type", Description: "match by type (f/d)"},
{Name: "-size", Description: "match by size"},
{Name: "-mtime", Description: "match by modified time"},
},
})
}
+20
View File
@@ -0,0 +1,20 @@
package search
import (
"github.com/versenilvis/iris/commands/core"
)
func init() {
core.Register(&core.Spec{
Name: "grep",
Description: "search text in files",
Generator: core.FileGenerator(),
Options: []core.Option{
{Name: "-r", Description: "recursive"},
{Name: "-i", Description: "ignore case"},
{Name: "-n", Description: "show line numbers"},
{Name: "-v", Description: "invert match"},
{Name: "-l", Description: "show filenames only"},
},
})
}