feat(commands): refactor and add more commands
This commit is contained in:
@@ -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"},
|
||||
},
|
||||
})
|
||||
}
|
||||
@@ -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"},
|
||||
},
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user