Skip to content

Commit

Permalink
updated the verbose output option
Browse files Browse the repository at this point in the history
  • Loading branch information
caffix committed Oct 18, 2024
1 parent 95a9200 commit 3a6a6d1
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions cmd/oam_assoc/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -152,9 +152,12 @@ func main() {
}

for _, name := range args.Domains.Slice() {
for _, assoc := range getAssociations(name, start, db) {
var rel string
for i, assoc := range getAssociations(name, start, db) {
if i != 0 {
fmt.Println()
}

var rel string
switch v := assoc.Asset.(type) {
case *oamreg.DomainRecord:
rel = "registrant_contact"
Expand All @@ -180,7 +183,9 @@ func main() {
}

if verbose {
afmt.B.Fprintf(color.Output, "\nRegistrant:\n")
printContactInfo(assoc, rel, start, db)
fmt.Println()
}
}
}
Expand All @@ -197,7 +202,7 @@ func printContactInfo(assoc *dbt.Asset, regrel string, since time.Time, db *asse
return
}

for _, out := range []string{"person", "organization", "location", "phone", "email", "url"} {
for _, out := range []string{"person", "organization", "location", "phone", "email"} {
if rels, err := db.OutgoingRelations(contact, since, out); err == nil && len(rels) > 0 {
for _, rel := range rels {
if a, err := db.FindById(rel.ToAsset.ID, since); err == nil && a != nil {
Expand Down

0 comments on commit 3a6a6d1

Please sign in to comment.