Thanks for this great tool, I wanted to use this code to keep encrypted backup files of my tokens, so I made some modifications and then tried to make them clean so that it can be useful to others:
Added two command line arguments (with default values the behavior is unchanged):
-save in order to save the encrypted backup file as json. In this case the decryption and console display of the tokens are disabled so that backup password is not required.
-load in order to load an encrypted backup file instead of fetching it from the server
I'll add some documentation if you are ok with merging this. I would advise to "hide whitespace" in the "diff view" for the review, as most of the changes are indented lines that are now in if blocks.
It's my first time reading or writing Go, so don't hesitate to advise improvements!
Thanks for this great tool, I wanted to use this code to keep encrypted backup files of my tokens, so I made some modifications and then tried to make them clean so that it can be useful to others:
Added two command line arguments (with default values the behavior is unchanged):
-save
in order to save the encrypted backup file as json. In this case the decryption and console display of the tokens are disabled so that backup password is not required.-load
in order to load an encrypted backup file instead of fetching it from the serverI'll add some documentation if you are ok with merging this. I would advise to "hide whitespace" in the "diff view" for the review, as most of the changes are indented lines that are now in
if
blocks.It's my first time reading or writing Go, so don't hesitate to advise improvements!