The idea of this PR is to change the approach used for CLI args parsing.
Problems:
With the new approach of Keystore strategies that are dynamically registered, we used global variables that store CLI params after parsing to initialize some KeystoreFabric. However, in acra-keys we cant use just package global variables as acra-keys migrate should contain two structs for storing CLI args - src_ and dst_. (They were stored on CommonKeyStoreParameters struct)
So the solution proposed is to have the ability to just Register and ParseCLI parameters separately. Besides that, each KeystoreFabric should be able to register its own set of Flags. So the main KeystoreFabric interface was extended with RegisterCLIParameters method.
Currently, I splited CLI params Registration and Parsing to separate steps, so that we can call Parse functions any time from any FlagSet which will create a new object for every Parsing,(It solves the issue with one global var)
All strategy CLI params registration was moved to `RegisterKeyStoreStrategyParametersWithFlags.
The idea of this PR is to change the approach used for CLI args parsing.
Problems: With the new approach of Keystore strategies that are dynamically registered, we used global variables that store CLI params after parsing to initialize some KeystoreFabric. However, in
acra-keys
we cant use just package global variables asacra-keys migrate
should contain two structs for storing CLI args -src_ and dst_
. (They were stored onCommonKeyStoreParameters
struct)So the solution proposed is to have the ability to just Register and ParseCLI parameters separately. Besides that, each KeystoreFabric should be able to register its own set of Flags. So the main KeystoreFabric interface was extended with
RegisterCLIParameters
method.Currently, I splited CLI params Registration and Parsing to separate steps, so that we can call Parse functions any time from any FlagSet which will create a new object for every Parsing,(It solves the issue with one global var)
All strategy CLI params registration was moved to `RegisterKeyStoreStrategyParametersWithFlags.
Checklist