aboutsummaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
authorjet2tlf <jet2tlf@gmail.com>2024-05-30 02:18:17 +0000
committerjet2tlf <jet2tlf@gmail.com>2024-05-30 02:18:17 +0000
commita299d37d9b85bd497bbf4bbf675e3339026d660d (patch)
tree917f2a977777f25dac6c258705f6cdd9f14c5638 /cmd
parent55664ef02d18b032f2c142fe89833236c851002c (diff)
downloadshell-go-a299d37d9b85bd497bbf4bbf675e3339026d660d.tar.gz
shell-go-a299d37d9b85bd497bbf4bbf675e3339026d660d.zip
pass 4st stage
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"))