1d2c18eaae
test / run tests/run_tests.py (pull_request) Successful in 13s
'bottles' was the package name when it held a single Bottle Protocol; since we added BottlePlatform / BottlePlan / BottleCleanupPlan and made it the home of platform dispatch, 'platform' describes the package better. The 'bottle' concept (and the manifest field) stays. CLI imports update from ..bottles to ..platform; internal relative imports inside the package survive the rename unchanged. Git detected all 7 file renames.
25 lines
652 B
Python
25 lines
652 B
Python
"""list: list available agents or active bottles."""
|
|
|
|
from __future__ import annotations
|
|
|
|
import argparse
|
|
|
|
from ..platform import get_bottle_platform
|
|
from ..manifest import Manifest
|
|
from ._common import PROG, USER_CWD
|
|
|
|
|
|
def cmd_list(argv: list[str]) -> int:
|
|
parser = argparse.ArgumentParser(prog=f"{PROG} list", add_help=True)
|
|
parser.add_argument("scope", choices=["available", "active"])
|
|
args = parser.parse_args(argv)
|
|
|
|
if args.scope == "available":
|
|
manifest = Manifest.resolve(USER_CWD)
|
|
for name in manifest.agents.keys():
|
|
print(name)
|
|
return 0
|
|
|
|
get_bottle_platform().list_active()
|
|
return 0
|