-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathutils.go
More file actions
49 lines (41 loc) · 1.62 KB
/
utils.go
File metadata and controls
49 lines (41 loc) · 1.62 KB
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
package main
import (
"bufio"
"flag"
"fmt"
"log"
"os"
)
// HELP ./gm -h
func help() {
fmt.Println(`
██████╗ ███╗ ███╗ ██╗ ██╗ █████╗ ██████╗██╗ ██╗
██╔════╝ ████╗ ████║ ██║ ██║██╔══██╗██╔════╝██║ ██╔╝
██║ ███╗██╔████╔██║ ███████║███████║██║ █████╔╝
██║ ██║██║╚██╔╝██║ ██╔══██║██╔══██║██║ ██╔═██╗
╚██████╔╝██║ ╚═╝ ██║ ██║ ██║██║ ██║╚██████╗██║ ██╗
╚═════╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝╚═╝ ╚═╝ ╚═════╝╚═╝ ╚═╝
(v1)
`)
fmt.Println("\t./gm {...flags}")
flag.Usage()
fmt.Println("\nNOTICE !")
fmt.Println("\t- Only one url is taken into account.")
fmt.Println("\t- Only one attribute is possible in the payload for version 1.")
fmt.Println("\t- All flags are not mandatory, except -u && -w && (-r || -l)")
fmt.Println("\t- You can stop the program at any moment with CRTL + C")
}
// Return message error + exit 84
func exitError(msg string) {
fmt.Println("\n-->\t[ERROR]", msg)
os.Exit(0)
}
// Open file and return content
func getFile(value string) *bufio.Scanner {
file, err := os.Open(value)
if err != nil {
log.Fatal(err)
}
res := bufio.NewScanner(file)
return res
}