fix: correct order of operations during loading Config files now get loaded or created before args are parsed.
This allows a default configuration to be generated by running
`livejrnl-rs` without needing to pass required args.
Diff
src/main.rs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
@@ -18,6 +18,7 @@ const APP_NAME: &str = "livejrnl-rs";
const ERR_JOURNAL_NOT_FOUND: &str = "ERROR: No journal data specified.\n\nUsage:\n\tjrnl --format json | livejrnl-rs";
fn main() {
let config_data = load_config();
let args: LaunchArgs = LaunchArgs::parse_args_default_or_exit();
@@ -33,7 +34,6 @@ fn main() {
let journal: Journal = util::journal::parse_journal_json(&jrnl_json);
let config_data = load_config();
match config_data {
Ok(config_data) => {
println!("{:#?}", config_data);