-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.go
65 lines (56 loc) · 1.55 KB
/
main.go
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
package main
import (
"fmt"
"os"
"bufio"
"ai-coder/utils"
"ai-coder/applications"
)
func main() {
var args []string
if len(os.Args) < 2 {
utils.StartMenu()
} else {
argument := os.Args[1]
if argument == "setup" {
utils.StartMenuChoice = "Setup"
} else
if argument == "s" || argument == "scripts" {
utils.StartMenuChoice = "Scripts"
fmt.Println("Module", utils.StartMenuChoice)
} else
if argument == "ai" {
utils.StartMenuChoice = "AI Assistant"
fmt.Println("Module", utils.StartMenuChoice)
} else
if argument == "p" || argument == "project" {
args = os.Args[1:]
utils.StartMenuChoice = "Projects"
fmt.Println("Module", utils.StartMenuChoice)
} else
if argument == "c" {
utils.StartMenuChoice = "Configurations"
fmt.Println("Module", utils.StartMenuChoice)
}
}
// Run the selected application
if utils.StartMenuChoice == "AI Assistant" {
applications.RunAiApplication()
} else
if utils.StartMenuChoice == "Projects" {
if len(args) == 0 { args = append(args, "p")}
applications.RunProjectsApplication(args)
} else
if utils.StartMenuChoice == "Configurations" {
if len(args) == 0 { args = append(args, "c")}
applications.RunConfigurationApplication(args)
} else
if utils.StartMenuChoice == "Scripts" {
if len(args) == 0 { args = append(args, "s")}
applications.RunScriptsApplication(args)
} else
if utils.StartMenuChoice == "Setup" {
scanner := bufio.NewScanner(os.Stdin)
utils.Setup(scanner)
}
}