summaryrefslogtreecommitdiff
path: root/src/frontend/cli
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2020-06-09 14:10:14 +0100
committerV3n3RiX <venerix@redcorelinux.org>2020-06-09 14:10:14 +0100
commit27e0407ab61bee10c924182b39f4c3a0b622d420 (patch)
tree5d73aa7421fee3cbd4b8c303e68c0a2accd56806 /src/frontend/cli
parentdc646ecd9650eadf65fb5d6f019b5d555289cc66 (diff)
sisyphus-cli : import the backend into the new client, plug the mirror module -> mirror setup works
Diffstat (limited to 'src/frontend/cli')
-rwxr-xr-xsrc/frontend/cli/sisyphus-cli.py20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/frontend/cli/sisyphus-cli.py b/src/frontend/cli/sisyphus-cli.py
index a0ca430..69e95b6 100755
--- a/src/frontend/cli/sisyphus-cli.py
+++ b/src/frontend/cli/sisyphus-cli.py
@@ -1,11 +1,12 @@
#!/usr/bin/python3
+import sisyphus
import typer
from typing import List
app = typer.Typer()
-mirror_cmd = typer.Typer()
-app.add_typer(mirror_cmd, name="mirror", help='List/set the active binary repository mirror.')
+mirrorSetup = typer.Typer()
+app.add_typer(mirrorSetup, name="mirror", help='List/Set the active binary repository mirror.')
@app.callback()
def app_callback():
@@ -114,16 +115,15 @@ def sysinfo():
"""Display information about installed core packages and portage configuration."""
typer.echo("Syncing sisyphus database ...")
-@mirror_cmd.command("list")
-def mirror_list():
- """List available binary package repository mirrors
- (the active one is marked with *)"""
- typer.echo("Listing available mirrors ...")
+@mirrorSetup.command("list")
+def mirrorlist():
+ """List available binary package repository mirrors (* means active)."""
+ sisyphus.mirror.printList()
-@mirror_cmd.command("set")
-def mirror_set(index: int):
+@mirrorSetup.command("set")
+def mirrorset(index: int):
"""Change the binary package repository to the selected mirror."""
- typer.echo(f"Setting mirror to: {index}")
+ sisyphus.mirror.setActive(index)
if __name__ == "__main__":
app()