Ver código fonte

[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>
lulz 1 ano atrás
pai
commit
ce0c95d097
1 arquivos alterados com 1 adições e 1 exclusões
  1. 1 1
      cmd/interactive.go

+ 1 - 1
cmd/interactive.go

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