Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions claude-current
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,9 @@ first when every installed copy is behind. Never resolved through PATH.
(status is verified, ahead, unverified or stale)
--offline no npm read and no update: the newest installed copy, unverified

On resolution, stdout is one absolute executable path (or the four porcelain
fields above). Diagnostics and update progress go to stderr.

Exit 0 resolved, 1 nothing runnable, 2 refused as stale, 64 usage or a
malformed CLAUDE_CURRENT_* bound.
CLAUDE_ALLOW_STALE=1 launches a stale copy anyway. The CLAUDE_CURRENT_*
Expand Down
12 changes: 12 additions & 0 deletions tests/test_claude_current.py
Original file line number Diff line number Diff line change
Expand Up @@ -1034,6 +1034,18 @@ def test_help_and_an_unknown_argument(box):
assert "unknown argument: --bogus" in result.stderr


@pytest.mark.parametrize("flag", ["--help", "-h"])
@pytest.mark.parametrize("name", ["TIMEOUT", "VERSION_TIMEOUT", "UPDATE_TIMEOUT", "LOCK_WAIT"])
def test_help_precedes_malformed_bounds_without_running_tools(box, flag, name):
result = box.run(flag, **{f"CLAUDE_CURRENT_{name}": "not-a-number"})
assert result.returncode == 0, result.stderr
assert result.stdout.startswith("claude-current [--porcelain] [--offline]\n")
assert result.stderr == ""
assert box.npm_log.read_text() == ""
assert box.node_log.read_text() == ""
assert box.claude_log.read_text() == ""


@pytest.mark.parametrize("name", ["TIMEOUT", "VERSION_TIMEOUT", "UPDATE_TIMEOUT", "LOCK_WAIT"])
def test_a_malformed_bound_is_refused_before_anything_runs(box, name):
"""64, the usage status, and not 1: a launcher reports 1 as "no Claude
Expand Down
Loading