From 9e5ebeffe3004bec4a0fd89c3de87a57850087a6 Mon Sep 17 00:00:00 2001 From: Bartek Pacia Date: Mon, 2 Sep 2024 14:17:43 +0200 Subject: [PATCH] add completion script --- maestro-cli/src/main/java/maestro/cli/App.kt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/maestro-cli/src/main/java/maestro/cli/App.kt b/maestro-cli/src/main/java/maestro/cli/App.kt index 73db5f04e5..bc6d6ff70d 100644 --- a/maestro-cli/src/main/java/maestro/cli/App.kt +++ b/maestro-cli/src/main/java/maestro/cli/App.kt @@ -36,6 +36,7 @@ import maestro.cli.update.Updates import maestro.cli.util.ErrorReporter import maestro.cli.view.box import maestro.debuglog.DebugLogStore +import picocli.AutoComplete.GenerateCompletion import picocli.CommandLine import picocli.CommandLine.Command import picocli.CommandLine.Option @@ -56,7 +57,8 @@ import kotlin.system.exitProcess LogoutCommand::class, BugReportCommand::class, StudioCommand::class, - StartDeviceCommand::class + StartDeviceCommand::class, + GenerateCompletion::class, ] ) class App { @@ -135,6 +137,9 @@ fun main(args: Array) { 1 } + val generateCompletionCommand = commandLine.subcommands["generate-completion"] + generateCompletionCommand?.commandSpec?.usageMessage()?.hidden(true) + val exitCode = commandLine .execute(*args)