diff options
Diffstat (limited to 'cmd')
-rw-r--r-- | cmd/ui/ui.go | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/cmd/ui/ui.go b/cmd/ui/ui.go index 82c0bc5..b5f2f2f 100644 --- a/cmd/ui/ui.go +++ b/cmd/ui/ui.go @@ -21,13 +21,13 @@ var UICommand = &cli.Command{ Usage: "interactive dictionary", Flags: []cli.Flag{ &cli.StringFlag{ - Name: "filename", + Name: "database", Value: "main.dict", Usage: "Dictionary database location", }, }, Action: func(cCtx *cli.Context) error { - name := cCtx.String("lang") + name := cCtx.String("database") return Run(context.Background(), name) }, } @@ -87,8 +87,10 @@ func Run(ctx context.Context, name string) error { }) input.SetDoneFunc(func(key tcell.Key) { - textView.Clear() - input.SetText("") + if key == tcell.KeyEscape { + textView.Clear() + input.SetText("") + } }) grid := tview.NewGrid(). |