aboutsummaryrefslogtreecommitdiff
path: root/cmd/myshell/main.go
diff options
context:
space:
mode:
Diffstat (limited to 'cmd/myshell/main.go')
-rw-r--r--cmd/myshell/main.go8
1 files changed, 7 insertions, 1 deletions
diff --git a/cmd/myshell/main.go b/cmd/myshell/main.go
index f5c858a..cebcdd0 100644
--- a/cmd/myshell/main.go
+++ b/cmd/myshell/main.go
@@ -4,11 +4,17 @@ import (
"bufio"
"fmt"
"os"
+ "strings"
)
func main() {
fmt.Fprint(os.Stdout, "$ ")
// Wait for user input
- bufio.NewReader(os.Stdin).ReadString('\n')
+ in, err := bufio.NewReader(os.Stdin).ReadString('\n')
+ if err != nil {
+ fmt.Fprintf(err.Error())
+ }
+
+ fml.Fprintf("%s: command not found\n", strings.TrimRight(in, "\n"))
}