Skip to content
Snippets Groups Projects
Commit 0d6a5e86 authored by Jake Taylor's avatar Jake Taylor
Browse files

clean up of cmd

parent 04806494
Branches
Tags
1 merge request!510Release
...@@ -295,26 +295,9 @@ func init() { ...@@ -295,26 +295,9 @@ func init() {
"Search for users with this email address.") "Search for users with this email address.")
bindFlagHelper(udSearchPhoneFlag, udCmd) 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.") "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) bindFlagHelper(udBatchAddFlag, udCmd)
rootCmd.AddCommand(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))
}
...@@ -117,7 +117,18 @@ func printRoundResults(rounds map[id.Round]cmix.RoundResult, roundIDs []id.Round ...@@ -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)", jww.ERROR.Printf("\tRound(s) %v timed out (no network resolution could be found)",
strings.Join(timedOutRounds, ",")) 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) { func writeContact(c contact.Contact) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment