aboutsummaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
Diffstat (limited to 'cmd')
-rw-r--r--cmd/myshell/main.go6
1 files changed, 4 insertions, 2 deletions
diff --git a/cmd/myshell/main.go b/cmd/myshell/main.go
index 99239ad..763ab2a 100644
--- a/cmd/myshell/main.go
+++ b/cmd/myshell/main.go
@@ -17,9 +17,11 @@ func main() {
fmt.Println(err.Error())
}
+ commads := strings.Split(in, " ")
+
switch in {
- case "exit\n":
- os.Exit(0)
+ case commnds[0] == "exit":
+ os.Exit(commands[1])
}
fmt.Printf("%s: command not found\n", strings.TrimRight(in, "\n"))