-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.go
More file actions
33 lines (28 loc) · 693 Bytes
/
main.go
File metadata and controls
33 lines (28 loc) · 693 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
package main
import (
"Minishell_1_Go/built-ins"
"Minishell_1_Go/display"
"Minishell_1_Go/user_input"
"fmt"
)
//func main() { os.Exit(myShell()) } // pour defer si jamais (Ex: close on defer)
func main() {
var exitStatus uint8
SHELL_LOOP: // juste pour utiliser des labels
for {
display.Prompt(&exitStatus)
name, argv := user_input.GetInput()
switch {
case name == "":
continue SHELL_LOOP
//alias.Check()
case builtins.Check(&exitStatus, name, argv):
continue SHELL_LOOP
//case execve.Check(&exitStatus):
//TO DO evaluate cmd
default:
fmt.Println("name", name, "\t", "argv", argv)
display.PrintError(&exitStatus, "test", display.UNKNOWNCMD)
}
}
}