-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathtarget_info.go
40 lines (37 loc) · 1.01 KB
/
target_info.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 (
"fmt"
"log"
)
func init() {
register(&Command{
group: "Target",
name: "target.info",
help: "Show target information",
handle: target_info,
})
}
func target_info() {
target, err := c.SelectedTarget()
if err != nil {
log.Fatal(err)
}
fmt.Println("")
fmt.Println("Alias :", target.Alias)
fmt.Println("URL :", target.TargetUrl)
fmt.Println("Username :", target.Username)
fmt.Println("")
info, err := target.Info()
if err != nil {
log.Fatal(err)
}
fmt.Println("Name :", info.Name)
fmt.Println("Build :", info.Build)
fmt.Println("Support :", info.Support)
fmt.Println("Version :", info.Version)
fmt.Println("Description :", info.Description)
fmt.Println("Authorization Endpoint :", info.AuthorizationEndpoint)
fmt.Println("Token Endpoint :", info.TokenEndpoint)
fmt.Println("API Version :", info.ApiVersion)
fmt.Println("")
}