3fae308e0554
add nina why <pkg> as top-level alias for nina pkg why — commands.why dispatches to exec.pkgWhy(args[0]); registered in main dispatch; 'why <pkg>' added to help — build+tests green, verified 'nina why ripgrep' and 'nina pkg why ripgrep' both run 'nix why-depends .# ripgrep', no-arg why gives clean 'package not found'
- time
- 2026-06-10 01:15 UTC · 4 months ago
- machine
- koh2
- agent
- claude-opus-4-8
- session
- nina community improvements
- parent
- 34a678d5d87d
↓ nina-3fae308e.tar.gzatlas at this save
files changed3 files
src/commands.zig+7 −0src/main.zig+1 −0src/output.zig+1 −0src/commands.zig+7 −0
@@ -1105,6 +1105,13 @@11051105 }11061106 }11071107 1108+// Top-level alias for `nina pkg why <pkg>` — surfaces what pulled a package in1109+// without the user needing to know about the `pkg` subgroup.1110+pub fn why(ctx: Ctx) !void {1111+ const name = if (ctx.args.len > 0) ctx.args[0] else return error.PackageNotFound;1112+ _ = try exec.pkgWhy(ctx.io, &ctx.machine, ctx.gpa, name);1113+}1114+11081115 // --- Pin / Unpin ---11091116 11101117 pub fn pin(ctx: Ctx) !void {src/main.zig+1 −0
@@ -215,6 +215,7 @@215215 if (std.mem.eql(u8, cmd, "channel")) return commands.channel(ctx);216216 if (std.mem.eql(u8, cmd, "profile")) return commands.profile(ctx);217217 if (std.mem.eql(u8, cmd, "pkg")) return commands.pkg(ctx);218+ if (std.mem.eql(u8, cmd, "why")) return commands.why(ctx);218219 if (std.mem.eql(u8, cmd, "pin")) return commands.pin(ctx);219220 if (std.mem.eql(u8, cmd, "unpin")) return commands.unpin(ctx);220221 if (std.mem.eql(u8, cmd, "hash")) return commands.hash(ctx);src/output.zig+1 −0
@@ -679,6 +679,7 @@679679 .{ "repl", "nix repl with nixpkgs" },680680 .{ "option <q>", "search nixos options" },681681 .{ "pkg", "inspect packages" },682+ .{ "why <pkg>", "what pulled a package in" },682683 .{ "pin", "pin flake inputs" },683684 .{ "hash", "compute nix hash" },684685 .{ "fetch", "fetch and hash a url" },