diff --git a/cmd/ud.go b/cmd/ud.go index cc9bbac169bb9faed5fcaaeaec52ac923ef28c33..06707a6f52d224d3f661c6dc664dc7d3a2238b69 100644 --- a/cmd/ud.go +++ b/cmd/ud.go @@ -295,26 +295,9 @@ func init() { "Search for users with this email address.") bindFlagHelper(udSearchPhoneFlag, udCmd) - udCmd.Flags().String("udBatch", "", + udCmd.Flags().String(udBatchAddFlag, "", "Path to JSON marshalled slice of partner IDs that will be looked up on UD.") - err := viper.BindPFlag("udBatch", udCmd.Flags().Lookup("udBatch")) - if err != nil { - jww.ERROR.Printf("viper.BindPFlag failed for %q: %+v", "udBatch", err) - } - bindFlagHelper(udBatchAddFlag, udCmd) rootCmd.AddCommand(udCmd) } - -func printContact(c contact.Contact) { - jww.DEBUG.Printf("Printing contact: %+v", c) - cBytes := c.Marshal() - if len(cBytes) == 0 { - jww.ERROR.Print("Marshaled contact has a size of 0.") - } else { - jww.DEBUG.Printf("Printing marshaled contact of size %d.", len(cBytes)) - } - - fmt.Print(string(cBytes)) -} diff --git a/cmd/utils.go b/cmd/utils.go index 09a908c47edfa63e09205de282d3ea4ef2fc9b16..723d1d47debb774415830137e9cdb0a87def4558 100644 --- a/cmd/utils.go +++ b/cmd/utils.go @@ -117,7 +117,18 @@ func printRoundResults(rounds map[id.Round]cmix.RoundResult, roundIDs []id.Round jww.ERROR.Printf("\tRound(s) %v timed out (no network resolution could be found)", strings.Join(timedOutRounds, ",")) } +} + +func printContact(c contact.Contact) { + jww.DEBUG.Printf("Printing contact: %+v", c) + cBytes := c.Marshal() + if len(cBytes) == 0 { + jww.ERROR.Print("Marshaled contact has a size of 0.") + } else { + jww.DEBUG.Printf("Printing marshaled contact of size %d.", len(cBytes)) + } + jww.INFO.Printf(string(cBytes)) } func writeContact(c contact.Contact) {