mirror of
https://github.com/onyx-and-iris/gobs-cli.git
synced 2025-07-16 09:51:48 +00:00
display (empty) if no text is set
This commit is contained in:
parent
f65af8298d
commit
c6406888a9
@ -5,7 +5,7 @@ All notable changes to this project will be documented in this file.
|
||||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
||||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||
|
||||
# [0.14.0] - 2025-07-14
|
||||
# [0.14.1] - 2025-07-14
|
||||
|
||||
### Added
|
||||
|
||||
|
9
text.go
9
text.go
@ -33,11 +33,18 @@ func (cmd *TextCurrentCmd) Run(ctx *context) error {
|
||||
return fmt.Errorf("input %s is of %s", cmd.InputName, kind)
|
||||
}
|
||||
|
||||
currentText, ok := resp.InputSettings["text"]
|
||||
if !ok {
|
||||
return fmt.Errorf("input %s does not have a 'text' setting", cmd.InputName)
|
||||
}
|
||||
if currentText == "" {
|
||||
currentText = "(empty)"
|
||||
}
|
||||
fmt.Fprintf(
|
||||
ctx.Out,
|
||||
"Current text for source %s: %s\n",
|
||||
ctx.Style.Highlight(cmd.InputName),
|
||||
resp.InputSettings["text"],
|
||||
currentText,
|
||||
)
|
||||
return nil
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user