-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathmain.go
More file actions
48 lines (34 loc) · 759 Bytes
/
main.go
File metadata and controls
48 lines (34 loc) · 759 Bytes
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
package main
import (
"log"
"os"
"path/filepath"
"sort"
cli "github.com/urfave/cli/v2"
)
var path, config, matchFiles, matchString, prefix string
func main() {
app := &cli.App{
Name: "isecode",
Usage: "utility cli tool to populate your code with traceable and secure error codes",
}
app.UseShortOptionHandling = true
app.Action = func(c *cli.Context) error {
handlePath()
loadConfig()
getPrefix()
// run process() fn from process.go for each file in this path
err := filepath.Walk(path, process)
if err != nil {
panic(err)
}
return nil
}
app.Flags = getFlags()
sort.Sort(cli.FlagsByName(app.Flags))
sort.Sort(cli.CommandsByName(app.Commands))
err := app.Run(os.Args)
if err != nil {
log.Fatal(err)
}
}