Skip to content
Snippets Groups Projects
Commit bf37e8aa authored by Josh Brooks's avatar Josh Brooks
Browse files

Resolve comments

parent 5fa924ee
No related branches found
No related tags found
2 merge requests!510Release,!343Hotfix/set legacy flag
......@@ -82,7 +82,7 @@ const (
profileCpuFlag = "profile-cpu"
profileMemFlag = "profile-mem"
userIdPrefixFlag = "userid-prefix"
setLegacyFlag = "setLegacy"
legacyFlag = "legacy"
///////////////// Broadcast subcommand flags //////////////////////////////
broadcastNameFlag = "name"
......
......@@ -45,24 +45,27 @@ var initCmd = &cobra.Command{
jww.FATAL.Panicf("%+v", err)
}
// Generate identity
var identity xxdk.ReceptionIdentity
if viper.GetBool(setLegacyFlag) {
if viper.GetBool(legacyFlag) {
identity, err = xxdk.MakeLegacyReceptionIdentity(net)
if err != nil {
jww.FATAL.Panicf("%+v", err)
}
} else {
identity, err = xxdk.MakeReceptionIdentity(net)
if err != nil {
jww.FATAL.Panicf("%+v", err)
}
}
// Panic if conditional branch fails
if err != nil {
jww.FATAL.Panicf("%+v", err)
}
// Store identity
err = xxdk.StoreReceptionIdentity(identityStorageKey, identity, net)
if err != nil {
jww.FATAL.Panicf("%+v", err)
}
// Write contact to file
jww.INFO.Printf("User: %s", identity.ID)
writeContact(identity.GetContact())
......@@ -76,9 +79,9 @@ func init() {
"Desired prefix of userID to brute force when running init command. Prepend (?i) for case-insensitive. Only Base64 characters are valid.")
bindFlagHelper(userIdPrefixFlag, initCmd)
initCmd.Flags().BoolP(setLegacyFlag, "", false,
"Generates a legacy contact file if set. Otherwise generates a standard contact file.")
bindFlagHelper(setLegacyFlag, initCmd)
initCmd.Flags().BoolP(legacyFlag, "", false,
"Generates a legacy identity if set. Otherwise generates a standard contact file.")
bindFlagHelper(legacyFlag, initCmd)
rootCmd.AddCommand(initCmd)
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment