use config defaults

This commit is contained in:
Emil Lerch 2026-04-21 12:12:12 -07:00
parent c938da2e3c
commit 0cb3b2948b
Signed by: lobo
GPG key ID: A7B62D657EF764F8
2 changed files with 6 additions and 6 deletions

View file

@ -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 {

View file

@ -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;
}