refactor: rename update command to upgrade

- Align CLI verb with pipx/pip terminology (`pipx upgrade`).
- Rename internal `self_update` to `self_upgrade` for consistency.
- Update README and tests accordingly.
- Bump version to 2.0.4.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-04-16 18:50:14 +08:00
parent cdc90a9be1
commit b857ea33f3
5 changed files with 13 additions and 13 deletions

View File

@@ -37,11 +37,11 @@ class CLITestCase(unittest.TestCase):
self.assertEqual(result, 1)
self.assertIn("error: boom", stderr.getvalue())
def test_update_dispatches(self):
def test_upgrade_dispatches(self):
captured = {}
with patch.object(cli, "self_update", return_value={"command": "pipx upgrade coinhunter", "returncode": 0}), patch.object(
with patch.object(cli, "self_upgrade", return_value={"command": "pipx upgrade coinhunter", "returncode": 0}), patch.object(
cli, "print_output", side_effect=lambda payload, **kwargs: captured.setdefault("payload", payload)
):
result = cli.main(["update"])
result = cli.main(["upgrade"])
self.assertEqual(result, 0)
self.assertEqual(captured["payload"]["returncode"], 0)