Merge key fetcher #6

Merged
zeridon merged 15 commits from master into master 2019-07-29 14:19:52 +03:00
1 changed files with 7 additions and 2 deletions
Showing only changes of commit 46f994e190 - Show all commits

View File

@ -26,6 +26,7 @@ func main() {
ghTeam := parser.String("t", "team", &argparse.Options{Required: false, Help: "Github Team name", Default: "NOC"}) ghTeam := parser.String("t", "team", &argparse.Options{Required: false, Help: "Github Team name", Default: "NOC"})
ghOrganization := parser.String("o", "org", &argparse.Options{Required: false, Help: "Github Organization name", Default: "OpenFest"}) ghOrganization := parser.String("o", "org", &argparse.Options{Required: false, Help: "Github Organization name", Default: "OpenFest"})
authToken := parser.String("a", "authtoken", &argparse.Options{Required: false, Help: "Github Auth token", Default: AuthToken}) authToken := parser.String("a", "authtoken", &argparse.Options{Required: false, Help: "Github Auth token", Default: AuthToken})
quiet := parser.Flag("q", "quiet", &argparse.Options{Required: false, Help: "Skip output to stdout", Default: false})
// Parse input // Parse input
err := parser.Parse(os.Args) err := parser.Parse(os.Args)
@ -106,7 +107,9 @@ func main() {
} }
for _, user := range nocMembers { for _, user := range nocMembers {
if *quiet == false {
fmt.Println("Fetching keys for ", *user) fmt.Println("Fetching keys for ", *user)
}
var sshKeys bytes.Buffer var sshKeys bytes.Buffer
for nextPage := 0; ; { for nextPage := 0; ; {
@ -125,7 +128,9 @@ func main() {
} }
for _, key := range keys { for _, key := range keys {
if *quiet == false {
fmt.Println(*key.Key) fmt.Println(*key.Key)
}
sshKeys.WriteString(*key.Key) sshKeys.WriteString(*key.Key)
sshKeys.WriteString("\n") sshKeys.WriteString("\n")
} }