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

@@ -10,7 +10,7 @@ from . import __version__
from .binance.spot_client import SpotBinanceClient
from .binance.um_futures_client import UMFuturesClient
from .config import ensure_init_files, get_binance_credentials, load_config
from .runtime import get_runtime_paths, print_output, self_update
from .runtime import get_runtime_paths, print_output, self_upgrade
from .services import account_service, market_service, opportunity_service, trade_service
EPILOG = """\
@@ -22,7 +22,7 @@ examples:
coinhunter trade spot buy BTCUSDT -q 100 -d
coinhunter trade futures sell BTCUSDT -q 0.01 -r
coinhunter opportunity scan -s BTCUSDT ETHUSDT
coinhunter update
coinhunter upgrade
"""
@@ -120,7 +120,7 @@ def build_parser() -> argparse.ArgumentParser:
scan_parser = opportunity_subparsers.add_parser("scan", help="Scan market for opportunities")
scan_parser.add_argument("-s", "--symbols", nargs="*", metavar="SYM", help="Restrict scan to specific symbols")
subparsers.add_parser("update", help="Upgrade coinhunter to the latest version")
subparsers.add_parser("upgrade", help="Upgrade coinhunter to the latest version")
return parser
@@ -258,8 +258,8 @@ def main(argv: list[str] | None = None) -> int:
return 0
parser.error("opportunity requires `portfolio` or `scan`")
if args.command == "update":
print_output(self_update(), agent=args.agent)
if args.command == "upgrade":
print_output(self_upgrade(), agent=args.agent)
return 0
parser.error(f"Unsupported command {args.command}")