From 0cb3b2948be9ac20910d95a793d3cf8ccdb80723 Mon Sep 17 00:00:00 2001 From: Emil Lerch Date: Tue, 21 Apr 2026 12:12:12 -0700 Subject: [PATCH] use config defaults --- src/main.zig | 10 +++++----- src/tui.zig | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main.zig b/src/main.zig index b53866f..6a13ee3 100644 --- a/src/main.zig +++ b/src/main.zig @@ -303,9 +303,9 @@ pub fn main() !u8 { return 1; } } - const pf = resolveUserPath(allocator, config, globals.portfolio_path, "portfolio.srf"); + const pf = resolveUserPath(allocator, config, globals.portfolio_path, zfin.Config.default_portfolio_filename); defer if (pf.resolved) |r| r.deinit(allocator); - const wl = resolveUserPath(allocator, config, globals.watchlist_path, "watchlist.srf"); + const wl = resolveUserPath(allocator, config, globals.watchlist_path, zfin.Config.default_watchlist_filename); defer if (wl.resolved) |r| r.deinit(allocator); const wl_path: ?[]const u8 = if (globals.watchlist_path != null or wl.resolved != null) wl.path else null; try commands.portfolio.run(allocator, &svc, pf.path, wl_path, force_refresh, color, out); @@ -328,7 +328,7 @@ pub fn main() !u8 { } try commands.enrich.run(allocator, &svc, cmd_args[0], out); } else if (std.mem.eql(u8, command, "audit")) { - const pf = resolveUserPath(allocator, config, globals.portfolio_path, "portfolio.srf"); + const pf = resolveUserPath(allocator, config, globals.portfolio_path, zfin.Config.default_portfolio_filename); defer if (pf.resolved) |r| r.deinit(allocator); try commands.audit.run(allocator, &svc, pf.path, cmd_args, color, out); } else if (std.mem.eql(u8, command, "analysis")) { @@ -336,7 +336,7 @@ pub fn main() !u8 { try reportUnexpectedArg("analysis", a); return 1; } - const pf = resolveUserPath(allocator, config, globals.portfolio_path, "portfolio.srf"); + const pf = resolveUserPath(allocator, config, globals.portfolio_path, zfin.Config.default_portfolio_filename); defer if (pf.resolved) |r| r.deinit(allocator); try commands.analysis.run(allocator, &svc, pf.path, color, out); } else if (std.mem.eql(u8, command, "contributions")) { @@ -344,7 +344,7 @@ pub fn main() !u8 { try reportUnexpectedArg("contributions", a); return 1; } - const pf = resolveUserPath(allocator, config, globals.portfolio_path, "portfolio.srf"); + const pf = resolveUserPath(allocator, config, globals.portfolio_path, zfin.Config.default_portfolio_filename); defer if (pf.resolved) |r| r.deinit(allocator); try commands.contributions.run(allocator, &svc, pf.path, color, out); } else { diff --git a/src/tui.zig b/src/tui.zig index 1282549..f21ce6a 100644 --- a/src/tui.zig +++ b/src/tui.zig @@ -2041,7 +2041,7 @@ pub fn run( var resolved_pf: ?zfin.Config.ResolvedPath = null; defer if (resolved_pf) |r| r.deinit(allocator); if (portfolio_path == null and !has_explicit_symbol) { - if (config.resolveUserFile(allocator, "portfolio.srf")) |r| { + if (config.resolveUserFile(allocator, zfin.Config.default_portfolio_filename)) |r| { resolved_pf = r; portfolio_path = r.path; }