mirror of
https://github.com/floci-io/floci-cli.git
synced 2026-11-23 14:10:50 -05:00
feat: adding gcp management
This commit is contained in:
26 files changed
+1455
-6
No files matched your search
@@ -3,6 +3,7 @@ package io.floci.cli;
|
||||
import io.floci.cli.commands.*;
|
||||
import io.floci.cli.commands.aws.AwsCommand;
|
||||
import io.floci.cli.commands.az.AzCommand;
|
||||
import io.floci.cli.commands.gcp.GcpCommand;
|
||||
import io.floci.cli.commands.config.ConfigCommand;
|
||||
import io.floci.cli.commands.snapshot.SnapshotCommand;
|
||||
import io.floci.cli.config.GlobalConfigStore;
|
||||
@@ -19,7 +20,8 @@ import picocli.CommandLine.*;
|
||||
" floci doctor — diagnose environment issues%n" +
|
||||
" floci env — print environment variables%n" +
|
||||
" floci aws — explicit AWS emulator commands%n" +
|
||||
" floci az — Azure emulator commands%n",
|
||||
" floci az — Azure emulator commands%n" +
|
||||
" floci gcp — GCP emulator commands%n",
|
||||
mixinStandardHelpOptions = true,
|
||||
versionProvider = FlociCli.VersionProvider.class,
|
||||
subcommands = {
|
||||
@@ -38,6 +40,7 @@ import picocli.CommandLine.*;
|
||||
CompletionCommand.class,
|
||||
AwsCommand.class,
|
||||
AzCommand.class,
|
||||
GcpCommand.class,
|
||||
HelpCommand.class
|
||||
}
|
||||
)
|
||||
@@ -73,6 +76,8 @@ public class FlociCli implements Runnable {
|
||||
String defaultProduct = new GlobalConfigStore().getDefaultProduct();
|
||||
if ("az".equals(defaultProduct)) {
|
||||
effectiveArgs = prepend("az", args);
|
||||
} else if ("gcp".equals(defaultProduct)) {
|
||||
effectiveArgs = prepend("gcp", args);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -88,7 +93,7 @@ public class FlociCli implements Runnable {
|
||||
private static boolean isExplicitProduct(String[] args) {
|
||||
for (String arg : args) {
|
||||
if (arg.startsWith("-")) continue;
|
||||
return "aws".equals(arg) || "az".equals(arg)
|
||||
return "aws".equals(arg) || "az".equals(arg) || "gcp".equals(arg)
|
||||
|| "config".equals(arg) || "completion".equals(arg) || "help".equals(arg);
|
||||
}
|
||||
return false;
|
||||
|
||||
Reference in new issue
Block a user