-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsentinel.go
65 lines (52 loc) · 1.16 KB
/
sentinel.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
58
59
60
61
62
63
64
65
package main
import (
"github.com/AndreaGhizzoni/sentinel/gitter"
"github.com/AndreaGhizzoni/sentinel/net"
"github.com/abiosoft/ishell"
"github.com/urfave/cli"
"os"
"sort"
)
const (
name = "sentinel"
version = "0.0.001"
usage = "TODO"
usageText = "TODO"
// commands
shellCommand = "shell"
shellUsage = "TODO usage"
)
func readEnvironment() {
gitter.AttachInput = os.Getenv("SSH_GRAPHIC_INPUT")
}
func main() {
readEnvironment()
app := cli.NewApp()
app.Name = name
app.Version = version
app.Usage = usage
app.UsageText = usageText
app.Authors = []cli.Author{
{Name: "Andrea Ghizzoni", Email: "andrea.ghz@gmail.com"},
}
app.Commands = []cli.Command{
{
Name: shellCommand,
Usage: shellUsage,
Action: runAsShell,
},
}
sort.Sort(cli.FlagsByName(app.Flags))
sort.Sort(cli.CommandsByName(app.Commands))
app.Run(os.Args)
}
func runAsShell(c *cli.Context) {
shell := ishell.New()
shell.Println("")
shell.Println("Welcome to Sentinel")
var nmap = net.NewScanner("scan", "TODO help")
var git = gitter.NewGitter("gitter", "TODO help")
shell.AddCmd(nmap.GetIShellCommand())
shell.AddCmd(git.GetIShellCommand())
shell.Run()
}