diff options
author | Piero Lescano <lescaspv@protonmail.com> | 2023-11-14 16:54:45 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-11-14 16:54:45 -0500 |
commit | dd557baf6a935bd0aa0f98a8084f64da166d3bc5 (patch) | |
tree | 03bc0d98497f0ccf0ac194632c93de7a70f31215 | |
parent | eb0e8afeba96fbbf22a487b7a4b7fca2f6c071e9 (diff) |
fix(input): Avoid reading from stdin if `--value` is being used (#448)v0.12.0
-rw-r--r-- | input/command.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/input/command.go b/input/command.go index 4094ddb..8ff1fe0 100644 --- a/input/command.go +++ b/input/command.go @@ -18,10 +18,10 @@ import ( // https://github.com/charmbracelet/bubbles/textinput func (o Options) Run() error { i := textinput.New() - if in, _ := stdin.Read(); in != "" && o.Value == "" { - i.SetValue(in) - } else { + if o.Value != "" { i.SetValue(o.Value) + } else if in, _ := stdin.Read(); in != "" { + i.SetValue(in) } i.Focus() |