Files
SatIntel/cli/cli.go
angelina-tsuboi 38d4f776e2 feat: init osint
2023-05-05 14:42:38 -07:00

56 lines
1.1 KiB
Go

package cli
import (
"fmt"
"io/ioutil"
"github.com/iskaa02/qalam/gradient"
"github.com/TwiN/go-color"
"github.com/ANG13T/SatIntel/osint"
"strconv"
"os"
)
func Option() {
fmt.Print("\n ENTER INPUT > ")
var selection string
fmt.Scanln(&selection)
num, err := strconv.Atoi(selection)
if err != nil {
fmt.Println(color.Ize(color.Red, " [!] INVALID INPUT"))
Option()
} else {
if (num >= 0 && num < 5) {
DisplayFunctions(num)
} else {
fmt.Println(color.Ize(color.Red, " [!] INVALID INPUT"))
Option()
}
}
}
func DisplayFunctions(x int) {
if (x == 0) {
fmt.Println(color.Ize(color.Blue, " Escaping Orbit..."))
os.Exit(1)
} else if (x == 4) {
osint.TLEParser()
}
}
func Banner() {
banner, _ := ioutil.ReadFile("txt/banner.txt")
info, _ := ioutil.ReadFile("txt/info.txt")
options, _ := ioutil.ReadFile("txt/options.txt")
g,_:=gradient.NewGradient("cyan", "blue")
solid,_:=gradient.NewGradient("blue", "#1179ef")
opt,_:=gradient.NewGradient("#1179ef", "cyan")
g.Print(string(banner))
solid.Print(string(info))
opt.Print("\n" + string(options))
}
func SatIntel() {
Banner()
Option()
}