You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Add cli option to group if it was called with a value
78
+
nonlocalmarker
79
+
ifvalueisFalse:
80
+
returnvalue
81
+
ifmarkerisNone:
82
+
marker=param.name
83
+
ifparam.name!=marker:
84
+
raisetyper.BadParameter(
85
+
f"{param.name} is mutually exclusive with {marker}")
86
+
returnvalue
87
+
returncallback
88
+
89
+
exclusivity_callback=MutuallyExclusiveBoolean()
90
+
68
91
@app.command()
69
92
defupload(
70
93
image: str=typer.Argument(..., help="Path to an image archive exported with docker save."),
71
94
path: str=typer.Argument(..., metavar="SCRIPT", help="A small script to start your container with parameters"),
72
-
from_remote: bool=typer.Option(False, "--from-remote", "-r", help=" If --from-remote, IMAGE is a registry to pull the image from. e.g: library/alpine, library/ubuntu:latest"),
73
-
from_daemon: bool=typer.Option(False, "--from-daemon", "-d", help=" If --from-daemon, IMAGE is an image in local docker deamon storage. You need docker installed for this command"),
95
+
from_remote: bool=typer.Option(False, "--from-remote", help=" If --from-remote, IMAGE is a registry to pull the image from. e.g: library/alpine, library/ubuntu:latest", callback=exclusivity_callback),
96
+
from_daemon: bool=typer.Option(False, "--from-daemon", help=" If --from-daemon, IMAGE is an image in local docker deamon storage. You need docker installed for this command", callback=exclusivity_callback),
97
+
from_created: bool=typer.Option(False, "--from-created", help=" If --from-created, IMAGE the path to a file created with 'aleph container create'", callback=exclusivity_callback),
docker_mountpoint: Optional[Path] =typer.Option(settings.DEFAULT_DOCKER_VOLUME_MOUNTPOINT, "--docker-mountpoint", help="The path where the created docker image volume will be mounted"),
image: str=typer.Argument(..., help="Path to an image archive exported with docker save."),
199
+
output: str=typer.Argument(..., help="The path where you want "),
200
+
from_remote: bool=typer.Option(False, "--from-remote", help=" If --from-remote, IMAGE is a registry to pull the image from. e.g: library/alpine, library/ubuntu:latest", callback=exclusivity_callback),
201
+
from_daemon: bool=typer.Option(False, "--from-daemon", help=" If --from-daemon, IMAGE is an image in local docker deamon storage. You need docker installed for this command", callback=exclusivity_callback),
0 commit comments