-
-
Notifications
You must be signed in to change notification settings - Fork 9
/
main.go
57 lines (52 loc) · 1.27 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
package main
import (
"bufio"
"flag"
"fmt"
"os"
"strings"
model "github.com/hahwul/gitls/pkg/model"
module "github.com/hahwul/gitls/pkg/modules"
printing "github.com/hahwul/gitls/pkg/printing"
)
func main() {
list := flag.String("l", "", "List of targets (e.g -l sample.lst)")
output := flag.String("o", "", "write output file (optional)")
version := flag.Bool("version", false, "version of gitls")
proxy := flag.String("proxy", "", "using custom proxy")
useTor := flag.Bool("tor", false, "using tor proxy / localhost:9050")
includeAccount := flag.Bool("include-users", false, "include repo of org users(member)")
flag.Parse()
options := model.Options{
Proxy: *proxy,
UseTor: *useTor,
Output: *output,
IncludeAccount: *includeAccount,
}
if *version {
fmt.Println(printing.VERSION)
return
}
if *list == "" {
sc := bufio.NewScanner(os.Stdin)
for sc.Scan() {
line := strings.ToLower(sc.Text())
if line != "" {
module.CheckURL(line, options)
}
if *includeAccount {
module.CheckAccount(line, options)
}
}
} else {
target, err := module.ReadLinesOrLiteral(*list)
_ = err
for i, v := range target {
_ = i
module.CheckURL(v, options)
if *includeAccount {
module.CheckAccount(v, options)
}
}
}
}