summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorskanehira <sho19921005@gmail.com>2019-11-05 12:12:24 +0900
committerskanehira <sho19921005@gmail.com>2019-11-05 12:14:00 +0900
commitfa2488ffba9b0dcf9b76d01f7d208d175a4e1411 (patch)
tree2c6b270c1ff1387c18ca2f536d6fcb87faa5af28
parenteb083ab12503efb3ccc12c06f2f448ae8c1f2b21 (diff)
add `proc` flag to saerch by word when starting1.3.1
-rw-r--r--gui/gui.go4
-rw-r--r--main.go5
2 files changed, 6 insertions, 3 deletions
diff --git a/gui/gui.go b/gui/gui.go
index f72f149..4a6266a 100644
--- a/gui/gui.go
+++ b/gui/gui.go
@@ -34,9 +34,11 @@ type Panels struct {
Kinds []int
}
-func New() *Gui {
+func New(word string) *Gui {
filterInput := tview.NewInputField().SetLabel("cmd name:")
+ filterInput.SetText(word)
processManager := NewProcessManager()
+ processManager.FilterWord = word
processInfoView := NewProcessInfoView()
processTreeView := NewProcessTreeView(processManager)
processEnvView := NewProcessEnvView()
diff --git a/main.go b/main.go
index 9d836e7..566ee41 100644
--- a/main.go
+++ b/main.go
@@ -13,7 +13,8 @@ import (
)
var (
- enableLog = flag.Bool("log", false, "enable output log")
+ enableLog = flag.Bool("log", false, "enable output log")
+ filterWord = flag.String("proc", "", "use word to filtering process name when starting")
)
func run() int {
@@ -38,7 +39,7 @@ func run() int {
log.SetOutput(ioutil.Discard)
}
- if err := gui.New().Run(); err != nil {
+ if err := gui.New(*filterWord).Run(); err != nil {
return 1
}