[fix] /bye and /exit are now treated as prefixes (#2381)

* [fix] /bye and /exit are now treated as prefixes
instead of being treated as entire lines which doesn't align with the way the rest of the commands are treated

* Update cmd/interactive.go

Fixing whitespace

---------

Co-authored-by: Jeffrey Morgan <jmorganca@gmail.com>
This commit is contained in:
lulz 2024-02-20 05:56:49 +03:00 committed by GitHub
parent a9bc1e1c37
commit ce0c95d097
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -470,7 +470,7 @@ func generateInteractive(cmd *cobra.Command, opts runOptions) error {
} else {
usage()
}
case line == "/exit", line == "/bye":
case strings.HasPrefix(line, "/exit"), strings.HasPrefix(line, "/bye"):
return nil
case strings.HasPrefix(line, "/"):
args := strings.Fields(line)