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

Add setLegacy flag

parent 7d39a948
No related branches found
No related tags found
2 merge requests!510Release,!343Hotfix/set legacy flag
......@@ -81,6 +81,7 @@ const (
sendIdFlag = "sendid"
profileCpuFlag = "profile-cpu"
userIdPrefixFlag = "userid-prefix"
setLegacyFlag = "setLegacy"
///////////////// Broadcast subcommand flags //////////////////////////////
broadcastNameFlag = "name"
......
......@@ -45,9 +45,17 @@ var initCmd = &cobra.Command{
jww.FATAL.Panicf("%+v", err)
}
identity, err := xxdk.MakeReceptionIdentity(net)
if err != nil {
jww.FATAL.Panicf("%+v", err)
var identity xxdk.ReceptionIdentity
if viper.GetBool(setLegacyFlag) {
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)
}
}
err = xxdk.StoreReceptionIdentity(identityStorageKey, identity, net)
......@@ -68,6 +76,10 @@ 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)
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