mirror of
https://github.com/floci-io/floci-cli.git
synced 2026-11-22 21:50:47 -05:00
fix(cli): keep the selected instance in the commands that hints suggest
Commands printed by errors, env and doctor now carry --profile, --container and an explicit --endpoint, so pasting one acts on the same instance. After a failed pull, the suggested start also keeps the --port, --image, --persist, --services and --namespace you typed. Signed-off-by: Hector Ventura <hectorvent@gmail.com>
This commit is contained in:
24 files changed
+247
-44
No files matched your search
@@ -68,6 +68,7 @@ public class AzEnvCommand implements Callable<Integer> {
|
||||
paramLabel = "<shell>")
|
||||
String shell;
|
||||
|
||||
private final DockerClient docker;
|
||||
private final Path stateRoot;
|
||||
private final AzSetupCommand.CertSource certSource;
|
||||
|
||||
@@ -81,6 +82,11 @@ public class AzEnvCommand implements Callable<Integer> {
|
||||
* each instance's config dir and CA; {@code certSource} reads the running server's CA.
|
||||
*/
|
||||
public AzEnvCommand(Path stateRoot, AzSetupCommand.CertSource certSource) {
|
||||
this(stateRoot, certSource, new DockerClient());
|
||||
}
|
||||
|
||||
public AzEnvCommand(Path stateRoot, AzSetupCommand.CertSource certSource, DockerClient docker) {
|
||||
this.docker = docker;
|
||||
this.stateRoot = stateRoot;
|
||||
this.certSource = certSource;
|
||||
}
|
||||
@@ -92,7 +98,7 @@ public class AzEnvCommand implements Callable<Integer> {
|
||||
printer.error(ShellExport.unsupported(shell));
|
||||
return 2;
|
||||
}
|
||||
String effectiveEndpoint = global.resolvedEndpoint(new DockerClient());
|
||||
String effectiveEndpoint = global.resolvedEndpoint(docker);
|
||||
int port = extractPort(effectiveEndpoint);
|
||||
|
||||
boolean sdkVarsMode = "sdk-vars".equals(format) || serviceFilter != null;
|
||||
@@ -121,7 +127,7 @@ public class AzEnvCommand implements Callable<Integer> {
|
||||
printer.println(ShellExport.formatExport(shell, "AZURE_STORAGE_CONNECTION_STRING", connStr));
|
||||
printAzCliVars(printer, azCliVars);
|
||||
printer.println("");
|
||||
printer.println(Ansi.gray("# Run: " + ShellExport.loadHint(shell, "floci az env")));
|
||||
printer.println(Ansi.gray("# Run: " + ShellExport.loadHint(shell, "floci az env" + global.instanceSelector())));
|
||||
} else {
|
||||
printer.println(ShellExport.formatExport(shell, "AZURE_STORAGE_ACCOUNT", account));
|
||||
printer.println(ShellExport.formatExport(shell, "AZURE_STORAGE_KEY", DEV_KEY));
|
||||
@@ -130,7 +136,7 @@ public class AzEnvCommand implements Callable<Integer> {
|
||||
}
|
||||
printAzCliVars(printer, azCliVars);
|
||||
printer.println("");
|
||||
printer.println(Ansi.gray("# Run: " + ShellExport.loadHint(shell, "floci az env --format sdk-vars")));
|
||||
printer.println(Ansi.gray("# Run: " + ShellExport.loadHint(shell, "floci az env --format sdk-vars" + global.instanceSelector())));
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
Reference in new issue
Block a user