diff options
Diffstat (limited to 'src/cli/package_manager_command.zig')
-rw-r--r-- | src/cli/package_manager_command.zig | 40 |
1 files changed, 22 insertions, 18 deletions
diff --git a/src/cli/package_manager_command.zig b/src/cli/package_manager_command.zig index 00326bc97..f51504a03 100644 --- a/src/cli/package_manager_command.zig +++ b/src/cli/package_manager_command.zig @@ -44,7 +44,7 @@ const ByName = struct { }; pub const PackageManagerCommand = struct { - pub fn printHelp(_: std.mem.Allocator) void {} + // pub fn printHelp(_: std.mem.Allocator) void {} pub fn printHash(ctx: Command.Context, lockfile_: []const u8) !void { @setCold(true); var lockfile_buffer: [bun.MAX_PATH_BYTES]u8 = undefined; @@ -83,6 +83,26 @@ pub const PackageManagerCommand = struct { return subcommand; } + pub fn printHelp() void { + Output.prettyln( + \\<b><blue>bun pm<r>: Package manager utilities + \\ + \\ bun pm <b>bin<r> print the path to bin folder + \\ bun pm <b>-g bin<r> print the <b>global<r> path to bin folder + \\ bun pm <b>ls<r> list the dependency tree according to the current lockfile + \\ bun pm <b>ls<r> <cyan>--all<r> list the entire dependency tree according to the current lockfile + \\ bun pm <b>hash<r> generate & print the hash of the current lockfile + \\ bun pm <b>hash-string<r> print the string used to hash the lockfile + \\ bun pm <b>hash-print<r> print the hash stored in the current lockfile + \\ bun pm <b>cache<r> print the path to the cache folder + \\ bun pm <b>cache rm<r> clear the cache + \\ bun pm <b>migrate<r> migrate another package manager's lockfile without installing anything + \\ + \\Learn more about these at <magenta>https://bun.sh/docs/install/utilities<r> + \\ + , .{}); + } + pub fn exec(ctx: Command.Context) !void { var args = try std.process.argsAlloc(ctx.allocator); args = args[1..]; @@ -272,23 +292,7 @@ pub const PackageManagerCommand = struct { Global.exit(0); } - Output.prettyln( - \\<b><blue>bun pm<r>: package manager related commands - \\ - \\ bun pm <b>bin<r> print the path to bin folder - \\ bun pm <b>-g bin<r> print the <b>global<r> path to bin folder - \\ bun pm <b>ls<r> list the dependency tree according to the current lockfile - \\ bun pm <b>ls --all<r> list the entire dependency tree according to the current lockfile - \\ bun pm <b>hash<r> generate & print the hash of the current lockfile - \\ bun pm <b>hash-string<r> print the string used to hash the lockfile - \\ bun pm <b>hash-print<r> print the hash stored in the current lockfile - \\ bun pm <b>cache<r> print the path to the cache folder - \\ bun pm <b>cache rm<r> clear the cache - \\ bun pm <b>migrate<r> migrate another package manager's lockfile without installing anything - \\ - \\Learn more about these at <magenta>https://bun.sh/docs/install/utilities<r> - \\ - , .{}); + printHelp(); if (subcommand.len > 0) { Output.prettyErrorln("\n<red>error<r>: \"{s}\" unknown command\n", .{subcommand}); |