-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmain.go
40 lines (33 loc) · 1004 Bytes
/
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
package main
import (
"docser/internal/scanner"
"flag"
"fmt"
"os"
)
func main() {
pRepoLocation := flag.String("d", "", "Directory to be scanned. (Default is current directory)")
pConfigFile := flag.String("c", "", "Docser config file (Must end in .toml)")
showHelp := flag.Bool("h", false, "Displays help menu")
flag.Parse()
if *showHelp {
showHelpMenu()
os.Exit(0)
}
printBanner()
repositoryPath := *pRepoLocation
configFile := *pConfigFile
scanner.ParseConfigAndInitiateScan(configFile, repositoryPath)
}
func showHelpMenu() {
fmt.Println("Usage: docser -d /path/to/directory -c /path/to/.docser.toml (Optional)")
flag.PrintDefaults()
}
func printBanner() {
fmt.Println("")
banner := "o-o \n| \\ \n| O o-o o-o o-o o-o o-o \n| / | | | \\ |-' | \no-o o-o o-o o-o o-o o \n \n "
fmt.Println(banner)
fmt.Println("by 0xFTW")
fmt.Println("")
fmt.Println("")
}