use config defaults
This commit is contained in:
parent
92b4c608ea
commit
7f01e57b4f
2 changed files with 6 additions and 6 deletions
10
src/main.zig
10
src/main.zig
|
|
@ -303,9 +303,9 @@ pub fn main() !u8 {
|
||||||
return 1;
|
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);
|
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);
|
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;
|
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);
|
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);
|
try commands.enrich.run(allocator, &svc, cmd_args[0], out);
|
||||||
} else if (std.mem.eql(u8, command, "audit")) {
|
} 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);
|
defer if (pf.resolved) |r| r.deinit(allocator);
|
||||||
try commands.audit.run(allocator, &svc, pf.path, cmd_args, color, out);
|
try commands.audit.run(allocator, &svc, pf.path, cmd_args, color, out);
|
||||||
} else if (std.mem.eql(u8, command, "analysis")) {
|
} else if (std.mem.eql(u8, command, "analysis")) {
|
||||||
|
|
@ -336,7 +336,7 @@ pub fn main() !u8 {
|
||||||
try reportUnexpectedArg("analysis", a);
|
try reportUnexpectedArg("analysis", a);
|
||||||
return 1;
|
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);
|
defer if (pf.resolved) |r| r.deinit(allocator);
|
||||||
try commands.analysis.run(allocator, &svc, pf.path, color, out);
|
try commands.analysis.run(allocator, &svc, pf.path, color, out);
|
||||||
} else if (std.mem.eql(u8, command, "contributions")) {
|
} else if (std.mem.eql(u8, command, "contributions")) {
|
||||||
|
|
@ -344,7 +344,7 @@ pub fn main() !u8 {
|
||||||
try reportUnexpectedArg("contributions", a);
|
try reportUnexpectedArg("contributions", a);
|
||||||
return 1;
|
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);
|
defer if (pf.resolved) |r| r.deinit(allocator);
|
||||||
try commands.contributions.run(allocator, &svc, pf.path, color, out);
|
try commands.contributions.run(allocator, &svc, pf.path, color, out);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
|
|
@ -2041,7 +2041,7 @@ pub fn run(
|
||||||
var resolved_pf: ?zfin.Config.ResolvedPath = null;
|
var resolved_pf: ?zfin.Config.ResolvedPath = null;
|
||||||
defer if (resolved_pf) |r| r.deinit(allocator);
|
defer if (resolved_pf) |r| r.deinit(allocator);
|
||||||
if (portfolio_path == null and !has_explicit_symbol) {
|
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;
|
resolved_pf = r;
|
||||||
portfolio_path = r.path;
|
portfolio_path = r.path;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue