diff --git a/CHANGELOG.md b/CHANGELOG.md index 4e68bf5..2b9491c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## [Unreleased] + +### Changed + +* Parameter -s accepte now one value (breaking change) + ## [0.3.0] - 2024-09-28 ### Added diff --git a/commands/text.go b/commands/text.go index 0d390c1..5b52c5b 100644 --- a/commands/text.go +++ b/commands/text.go @@ -96,29 +96,24 @@ func textFlags() []cli.Flag { return nil }, }, - &cli.StringSliceFlag{ + &cli.StringFlag{ Name: "context", Aliases: []string{"s"}, Usage: l.Get("text-system-usage"), Category: "text", - Action: func(c *cli.Context, values []string) error { + Action: func(c *cli.Context, value string) error { text := sdk.GetSdkText() - var content []string - for _, value := range values { - if value == "-" { - stdin, err := io.ReadAll(os.Stdin) - if err != nil { - return err - } - - value = string(stdin) + if value == "-" { + stdin, err := io.ReadAll(os.Stdin) + if err != nil { + return err } - content = append(content, value) + value = string(stdin) } - text.AppendHistory("system", content...) + text.AppendHistory("system", value) return nil },