From 0d6a5e86e8045f24255e52ef84540fef461d610c Mon Sep 17 00:00:00 2001 From: Jake Taylor <jake@elixxir.io> Date: Tue, 19 Jul 2022 14:31:46 -0500 Subject: [PATCH] clean up of cmd --- cmd/ud.go | 19 +------------------ cmd/utils.go | 11 +++++++++++ 2 files changed, 12 insertions(+), 18 deletions(-) diff --git a/cmd/ud.go b/cmd/ud.go index cc9bbac16..06707a6f5 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 09a908c47..723d1d47d 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) { -- GitLab