diff --git a/src/install/PackageManager/CommandLineArguments.zig b/src/install/PackageManager/CommandLineArguments.zig index ea47d3c98b..6413f46349 100644 --- a/src/install/PackageManager/CommandLineArguments.zig +++ b/src/install/PackageManager/CommandLineArguments.zig @@ -27,7 +27,7 @@ const shared_params = [_]ParamType{ clap.parseParam("--save Save to package.json (true by default)") catch unreachable, clap.parseParam("--ca ... Provide a Certificate Authority signing certificate") catch unreachable, clap.parseParam("--cafile The same as `--ca`, but is a file path to the certificate") catch unreachable, - clap.parseParam("--dry-run Don't install anything") catch unreachable, + clap.parseParam("--dry-run Perform a dry run without making changes") catch unreachable, clap.parseParam("--frozen-lockfile Disallow changes to lockfile") catch unreachable, clap.parseParam("-f, --force Always request the latest versions from the registry & reinstall all dependencies") catch unreachable, clap.parseParam("--cache-dir Store & load cached data from a specific directory path") catch unreachable, diff --git a/test/regression/issue/24806.test.ts b/test/regression/issue/24806.test.ts new file mode 100644 index 0000000000..6ac23b69cf --- /dev/null +++ b/test/regression/issue/24806.test.ts @@ -0,0 +1,23 @@ +import { expect, test } from "bun:test"; +import { bunEnv, bunExe } from "harness"; + +test("bun publish --help shows correct message for --dry-run", async () => { + await using proc = Bun.spawn({ + cmd: [bunExe(), "publish", "--help"], + env: bunEnv, + stdout: "pipe", + stderr: "pipe", + }); + + const [stdout, stderr, exitCode] = await Promise.all([proc.stdout.text(), proc.stderr.text(), proc.exited]); + + // The --dry-run flag should have a generic description that works for all commands + // It should NOT say "Don't install anything" when used with "bun publish" + expect(stdout).toContain("--dry-run"); + expect(stdout).toContain("Perform a dry run without making changes"); + + // Make sure it doesn't contain the old incorrect message + expect(stdout).not.toContain("Don't install anything"); + + expect(exitCode).toBe(0); +});