Right now there are several points of entry for data:
Config
CLI flags
Environment variables
Constants
Clap defaults
Module-level defaults
The logic around that data is spread out and needs to be unified. Some include:
general util functions
App methods
DB methods
Clap matching/extracting functions
Features/tasks:
[x] Create a new input module and gather existing input-specific modules in it (including config stuff)
[x] Identify all current use of config in rucksack-lib (checking for possible cyclic deps) and move to input module
[x] Establish order of precedence for ENV vars, config file values, CLI options, module-level defaults, etc.
[x] Ensure (with tests) that ENV vars for all CLI flags work as expected, according to established order of precedence
[ ] Model input data
[x] create a new input/model.rs module
[x] move current config "schemas" here
[ ] add input model structs for all applicable CLI flags that currently do not have one
[ ] implement methods/utility functions for merging/unifying the various input data sources and populating the model structs
[x] Remove all defaults from CLI options
[x] Implement defaults in input module
[ ] For all applicable input model structs items that currently do not have CLI flags, create CLI flags
[ ] Update the entire app to ONLY use the input model for all data
The above changes have resulted in some bugs that popped up:
[x] Fix issue with db files not being loaded because the CLI assumes a given command doesn't require DB access (this is true of very few commands, e.g., for rucksack gen)
[x] Fix the issue where password history cannot be properly displayed in the CLI
[ ] Fix the issue of querying type any and category any don't actually match any of their respective fields
Right now there are several points of entry for data:
The logic around that data is spread out and needs to be unified. Some include:
Features/tasks:
input
module and gather existing input-specific modules in it (including config stuff)rucksack-lib
(checking for possible cyclic deps) and move to input moduleinput/model.rs
moduleThe above changes have resulted in some bugs that popped up:
rucksack gen
)any
and categoryany
don't actually match any of their respective fields