diff --git a/cchat.go b/cchat.go index f90cde0..5151cd2 100644 --- a/cchat.go +++ b/cchat.go @@ -252,15 +252,16 @@ type Backlogger interface { // are not in cchat through a very basic terminal interface. type Commander interface { // Run executes the given command, with the slice being already split arguments, - // similar to os.Args. The function could return an output stream, in which the - // frontend must display it live and close it on EOF. + // similar to os.Args. The function can return both a []byte and an error value. + // The frontend should render the byte slice's value first, then display the + // error. // - // The function can do IO, and outputs should be written to the given io.Writer. + // This function can do IO. // // The client should make guarantees that an empty string (and thus a // zero-length string slice) should be ignored. The backend should be able to // assume that the argument slice is always length 1 or more. - Run([]string, io.Writer) error // Blocking + Run(words []string) ([]byte, error) // Blocking // Asserters. diff --git a/repository/main.go b/repository/main.go index 4ebe050..b93c6e2 100644 --- a/repository/main.go +++ b/repository/main.go @@ -851,23 +851,23 @@ var Main = Packages{ Comment: Comment{` Run executes the given command, with the slice being already split arguments, similar to os.Args. The - function could return an output stream, in which the - frontend must display it live and close it on EOF. + function can return both a []byte and an error + value. The frontend should render the byte slice's + value first, then display the error. - The function can do IO, and outputs should be - written to the given io.Writer. + This function can do IO. The client should make guarantees that an empty string (and thus a zero-length string slice) should - be ignored. The backend should be able to assume + be ignored. The backend should be able to assume that the argument slice is always length 1 or more. `}, Name: "Run", }, Parameters: []NamedType{ - {Type: "[]string"}, - {Type: "io.Writer"}, + {Name: "words", Type: "[]string"}, }, + ReturnValue: NamedType{Type: "[]byte"}, ReturnError: true, }, AsserterMethod{ChildType: "Completer"},