From 859bffba2d36134f025c929feaaf34c42fec9bf9 Mon Sep 17 00:00:00 2001 From: Adam Date: Tue, 8 Jun 2021 17:13:42 +0200 Subject: [PATCH 1/7] Added help commands --- .../main/kotlin/ftl/presentation/cli/AuthCommand.kt | 10 +++++++++- .../kotlin/ftl/presentation/cli/CorelliumCommand.kt | 10 +++++++++- .../kotlin/ftl/presentation/cli/FirebaseCommand.kt | 10 +++++++++- .../main/kotlin/ftl/presentation/cli/MainCommand.kt | 7 +++++++ .../ftl/presentation/cli/corellium/TestCommand.kt | 10 +++++++++- .../presentation/cli/corellium/test/AndroidCommand.kt | 10 +++++++++- .../ftl/presentation/cli/firebase/TestCommand.kt | 10 +++++++++- .../presentation/cli/firebase/test/AndroidCommand.kt | 10 +++++++++- .../presentation/cli/firebase/test/IPBlocksCommand.kt | 9 ++++++++- .../ftl/presentation/cli/firebase/test/IosCommand.kt | 10 +++++++++- .../cli/firebase/test/NetworkProfilesCommand.kt | 9 ++++++++- .../cli/firebase/test/ProvidedSoftwareCommand.kt | 9 ++++++++- .../cli/firebase/test/android/AndroidLocalesCommand.kt | 9 ++++++++- .../cli/firebase/test/android/AndroidModelsCommand.kt | 9 ++++++++- .../test/android/AndroidOrientationsCommand.kt | 9 ++++++++- .../firebase/test/android/AndroidVersionsCommand.kt | 9 ++++++++- .../android/locales/AndroidLocalesDescribeCommand.kt | 7 +++++++ .../android/versions/AndroidVersionsDescribeCommand.kt | 7 +++++++ .../cli/firebase/test/ios/IosLocalesCommand.kt | 9 ++++++++- .../cli/firebase/test/ios/IosModelsCommand.kt | 9 ++++++++- .../cli/firebase/test/ios/IosOrientationsCommand.kt | 9 ++++++++- .../cli/firebase/test/ios/IosVersionsCommand.kt | 9 ++++++++- .../ios/configuration/IosLocalesDescribeCommand.kt | 7 +++++++ .../test/ios/versions/IosVersionsDescribeCommand.kt | 7 +++++++ .../cli/firebase/test/ipblocks/IPBlocksListCommand.kt | 8 ++++++++ .../networkprofiles/NetworkProfilesDescribeCommand.kt | 7 +++++++ .../test/networkprofiles/NetworkProfilesListCommand.kt | 8 ++++++++ .../providedsoftware/ProvidedSoftwareListCommand.kt | 7 +++++++ 28 files changed, 225 insertions(+), 19 deletions(-) diff --git a/test_runner/src/main/kotlin/ftl/presentation/cli/AuthCommand.kt b/test_runner/src/main/kotlin/ftl/presentation/cli/AuthCommand.kt index 4dab99c334..8143631cc0 100644 --- a/test_runner/src/main/kotlin/ftl/presentation/cli/AuthCommand.kt +++ b/test_runner/src/main/kotlin/ftl/presentation/cli/AuthCommand.kt @@ -2,6 +2,7 @@ package ftl.presentation.cli import ftl.presentation.cli.auth.LoginCommand import ftl.util.PrintHelp +import picocli.CommandLine import picocli.CommandLine.Command @Command( @@ -13,4 +14,11 @@ import picocli.CommandLine.Command ], usageHelpAutoWidth = true ) -class AuthCommand : PrintHelp +class AuthCommand : PrintHelp { + @CommandLine.Option( + names = ["-h", "--help"], + usageHelp = true, + description = ["Prints this help message"] + ) + var usageHelpRequested: Boolean = false +} diff --git a/test_runner/src/main/kotlin/ftl/presentation/cli/CorelliumCommand.kt b/test_runner/src/main/kotlin/ftl/presentation/cli/CorelliumCommand.kt index 72911b7a84..0d1fdc580c 100644 --- a/test_runner/src/main/kotlin/ftl/presentation/cli/CorelliumCommand.kt +++ b/test_runner/src/main/kotlin/ftl/presentation/cli/CorelliumCommand.kt @@ -2,6 +2,7 @@ package ftl.presentation.cli import ftl.presentation.cli.corellium.TestCommand import ftl.util.PrintHelp +import picocli.CommandLine import picocli.CommandLine.Command @Command( @@ -12,4 +13,11 @@ import picocli.CommandLine.Command ], usageHelpAutoWidth = true ) -class CorelliumCommand : PrintHelp +class CorelliumCommand : PrintHelp { + @CommandLine.Option( + names = ["-h", "--help"], + usageHelp = true, + description = ["Prints this help message"] + ) + var usageHelpRequested: Boolean = false +} diff --git a/test_runner/src/main/kotlin/ftl/presentation/cli/FirebaseCommand.kt b/test_runner/src/main/kotlin/ftl/presentation/cli/FirebaseCommand.kt index 6bfc81e463..bd7cebe6cb 100644 --- a/test_runner/src/main/kotlin/ftl/presentation/cli/FirebaseCommand.kt +++ b/test_runner/src/main/kotlin/ftl/presentation/cli/FirebaseCommand.kt @@ -4,6 +4,7 @@ import ftl.presentation.cli.firebase.CancelCommand import ftl.presentation.cli.firebase.RefreshCommand import ftl.presentation.cli.firebase.TestCommand import ftl.util.PrintHelp +import picocli.CommandLine import picocli.CommandLine.Command @Command( @@ -16,4 +17,11 @@ import picocli.CommandLine.Command ], usageHelpAutoWidth = true ) -class FirebaseCommand : PrintHelp +class FirebaseCommand : PrintHelp { + @CommandLine.Option( + names = ["-h", "--help"], + usageHelp = true, + description = ["Prints this help message"] + ) + var usageHelpRequested: Boolean = false +} diff --git a/test_runner/src/main/kotlin/ftl/presentation/cli/MainCommand.kt b/test_runner/src/main/kotlin/ftl/presentation/cli/MainCommand.kt index e7acf9df47..c6af0865d9 100644 --- a/test_runner/src/main/kotlin/ftl/presentation/cli/MainCommand.kt +++ b/test_runner/src/main/kotlin/ftl/presentation/cli/MainCommand.kt @@ -35,6 +35,13 @@ class MainCommand : Runnable { ) private var printVersion = false + @CommandLine.Option( + names = ["-h", "--help"], + usageHelp = true, + description = ["Prints this help message"] + ) + var usageHelpRequested: Boolean = false + @CommandLine.Option( names = ["--debug"], description = ["Enables debug logging"], diff --git a/test_runner/src/main/kotlin/ftl/presentation/cli/corellium/TestCommand.kt b/test_runner/src/main/kotlin/ftl/presentation/cli/corellium/TestCommand.kt index f4ad3c69f7..eb0066309e 100644 --- a/test_runner/src/main/kotlin/ftl/presentation/cli/corellium/TestCommand.kt +++ b/test_runner/src/main/kotlin/ftl/presentation/cli/corellium/TestCommand.kt @@ -2,6 +2,7 @@ package ftl.presentation.cli.corellium import ftl.presentation.cli.corellium.test.AndroidCommand import ftl.util.PrintHelp +import picocli.CommandLine import picocli.CommandLine.Command @Command( @@ -12,4 +13,11 @@ import picocli.CommandLine.Command ], usageHelpAutoWidth = true ) -class TestCommand : PrintHelp +class TestCommand : PrintHelp { + @CommandLine.Option( + names = ["-h", "--help"], + usageHelp = true, + description = ["Prints this help message"] + ) + var usageHelpRequested: Boolean = false +} diff --git a/test_runner/src/main/kotlin/ftl/presentation/cli/corellium/test/AndroidCommand.kt b/test_runner/src/main/kotlin/ftl/presentation/cli/corellium/test/AndroidCommand.kt index c83bb81c0f..39bb98b68b 100644 --- a/test_runner/src/main/kotlin/ftl/presentation/cli/corellium/test/AndroidCommand.kt +++ b/test_runner/src/main/kotlin/ftl/presentation/cli/corellium/test/AndroidCommand.kt @@ -2,6 +2,7 @@ package ftl.presentation.cli.corellium.test import flank.corellium.cli.RunTestCorelliumAndroidCommand import ftl.util.PrintHelp +import picocli.CommandLine import picocli.CommandLine.Command @Command( @@ -12,4 +13,11 @@ import picocli.CommandLine.Command ], usageHelpAutoWidth = true ) -class AndroidCommand : PrintHelp +class AndroidCommand : PrintHelp { + @CommandLine.Option( + names = ["-h", "--help"], + usageHelp = true, + description = ["Prints this help message"] + ) + var usageHelpRequested: Boolean = false +} diff --git a/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/TestCommand.kt b/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/TestCommand.kt index 382acc1f87..1ab648331d 100644 --- a/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/TestCommand.kt +++ b/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/TestCommand.kt @@ -6,6 +6,7 @@ import ftl.presentation.cli.firebase.test.IosCommand import ftl.presentation.cli.firebase.test.NetworkProfilesCommand import ftl.presentation.cli.firebase.test.ProvidedSoftwareCommand import ftl.util.PrintHelp +import picocli.CommandLine import picocli.CommandLine.Command @Command( @@ -20,4 +21,11 @@ import picocli.CommandLine.Command ], usageHelpAutoWidth = true ) -class TestCommand : PrintHelp +class TestCommand : PrintHelp { + @CommandLine.Option( + names = ["-h", "--help"], + usageHelp = true, + description = ["Prints this help message"] + ) + var usageHelpRequested: Boolean = false +} diff --git a/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/AndroidCommand.kt b/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/AndroidCommand.kt index 494009b8c2..8367812068 100644 --- a/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/AndroidCommand.kt +++ b/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/AndroidCommand.kt @@ -8,6 +8,7 @@ import ftl.presentation.cli.firebase.test.android.AndroidRunCommand import ftl.presentation.cli.firebase.test.android.AndroidTestEnvironmentCommand import ftl.presentation.cli.firebase.test.android.AndroidVersionsCommand import ftl.util.PrintHelp +import picocli.CommandLine import picocli.CommandLine.Command @Command( @@ -24,4 +25,11 @@ import picocli.CommandLine.Command ], usageHelpAutoWidth = true ) -class AndroidCommand : PrintHelp +class AndroidCommand : PrintHelp { + @CommandLine.Option( + names = ["-h", "--help"], + usageHelp = true, + description = ["Prints this help message"] + ) + var usageHelpRequested: Boolean = false +} diff --git a/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/IPBlocksCommand.kt b/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/IPBlocksCommand.kt index a48392a8b3..9bc2d146c1 100644 --- a/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/IPBlocksCommand.kt +++ b/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/IPBlocksCommand.kt @@ -11,4 +11,11 @@ import picocli.CommandLine header = ["Explore IP blocks used by Firebase Test Lab devices."], usageHelpAutoWidth = true ) -class IPBlocksCommand : PrintHelp +class IPBlocksCommand : PrintHelp { + @CommandLine.Option( + names = ["-h", "--help"], + usageHelp = true, + description = ["Prints this help message"] + ) + var usageHelpRequested: Boolean = false +} diff --git a/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/IosCommand.kt b/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/IosCommand.kt index 3e8a00059e..c39f76367a 100644 --- a/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/IosCommand.kt +++ b/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/IosCommand.kt @@ -8,6 +8,7 @@ import ftl.presentation.cli.firebase.test.ios.IosRunCommand import ftl.presentation.cli.firebase.test.ios.IosTestEnvironmentCommand import ftl.presentation.cli.firebase.test.ios.IosVersionsCommand import ftl.util.PrintHelp +import picocli.CommandLine import picocli.CommandLine.Command @Command( @@ -24,4 +25,11 @@ import picocli.CommandLine.Command ], usageHelpAutoWidth = true ) -class IosCommand : PrintHelp +class IosCommand : PrintHelp { + @CommandLine.Option( + names = ["-h", "--help"], + usageHelp = true, + description = ["Prints this help message"] + ) + var usageHelpRequested: Boolean = false +} diff --git a/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/NetworkProfilesCommand.kt b/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/NetworkProfilesCommand.kt index 1958fbbe68..94f6b46691 100644 --- a/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/NetworkProfilesCommand.kt +++ b/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/NetworkProfilesCommand.kt @@ -15,4 +15,11 @@ import picocli.CommandLine header = ["Explore network profiles available for testing."], usageHelpAutoWidth = true ) -class NetworkProfilesCommand : PrintHelp +class NetworkProfilesCommand : PrintHelp { + @CommandLine.Option( + names = ["-h", "--help"], + usageHelp = true, + description = ["Prints this help message"] + ) + var usageHelpRequested: Boolean = false +} diff --git a/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/ProvidedSoftwareCommand.kt b/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/ProvidedSoftwareCommand.kt index bb59c28f27..d3b73d5dd6 100644 --- a/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/ProvidedSoftwareCommand.kt +++ b/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/ProvidedSoftwareCommand.kt @@ -12,4 +12,11 @@ import picocli.CommandLine ], usageHelpAutoWidth = true ) -class ProvidedSoftwareCommand : PrintHelp +class ProvidedSoftwareCommand : PrintHelp { + @CommandLine.Option( + names = ["-h", "--help"], + usageHelp = true, + description = ["Prints this help message"] + ) + var usageHelpRequested: Boolean = false +} diff --git a/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/android/AndroidLocalesCommand.kt b/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/android/AndroidLocalesCommand.kt index f40bf45f87..439f3a454c 100644 --- a/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/android/AndroidLocalesCommand.kt +++ b/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/android/AndroidLocalesCommand.kt @@ -17,4 +17,11 @@ import picocli.CommandLine subcommands = [AndroidLocalesListCommand::class, AndroidLocalesDescribeCommand::class], usageHelpAutoWidth = true ) -class AndroidLocalesCommand : PrintHelp +class AndroidLocalesCommand : PrintHelp { + @CommandLine.Option( + names = ["-h", "--help"], + usageHelp = true, + description = ["Prints this help message"] + ) + var usageHelpRequested: Boolean = false +} diff --git a/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/android/AndroidModelsCommand.kt b/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/android/AndroidModelsCommand.kt index ed57414148..e10d6a7a77 100644 --- a/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/android/AndroidModelsCommand.kt +++ b/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/android/AndroidModelsCommand.kt @@ -17,4 +17,11 @@ import picocli.CommandLine subcommands = [AndroidModelsListCommand::class, AndroidModelDescribeCommand::class], usageHelpAutoWidth = true ) -class AndroidModelsCommand : PrintHelp +class AndroidModelsCommand : PrintHelp { + @CommandLine.Option( + names = ["-h", "--help"], + usageHelp = true, + description = ["Prints this help message"] + ) + var usageHelpRequested: Boolean = false +} diff --git a/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/android/AndroidOrientationsCommand.kt b/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/android/AndroidOrientationsCommand.kt index 94818daeaf..b82d624035 100644 --- a/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/android/AndroidOrientationsCommand.kt +++ b/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/android/AndroidOrientationsCommand.kt @@ -16,4 +16,11 @@ import picocli.CommandLine subcommands = [AndroidOrientationsListCommand::class], usageHelpAutoWidth = true ) -class AndroidOrientationsCommand : PrintHelp +class AndroidOrientationsCommand : PrintHelp { + @CommandLine.Option( + names = ["-h", "--help"], + usageHelp = true, + description = ["Prints this help message"] + ) + var usageHelpRequested: Boolean = false +} diff --git a/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/android/AndroidVersionsCommand.kt b/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/android/AndroidVersionsCommand.kt index 849dbb2fa9..e62f6244b2 100644 --- a/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/android/AndroidVersionsCommand.kt +++ b/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/android/AndroidVersionsCommand.kt @@ -17,4 +17,11 @@ import picocli.CommandLine subcommands = [AndroidVersionsListCommand::class, AndroidVersionsDescribeCommand::class], usageHelpAutoWidth = true ) -class AndroidVersionsCommand : PrintHelp +class AndroidVersionsCommand : PrintHelp { + @CommandLine.Option( + names = ["-h", "--help"], + usageHelp = true, + description = ["Prints this help message"] + ) + var usageHelpRequested: Boolean = false +} diff --git a/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/android/locales/AndroidLocalesDescribeCommand.kt b/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/android/locales/AndroidLocalesDescribeCommand.kt index ab0ec369b4..c9a8031fd1 100644 --- a/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/android/locales/AndroidLocalesDescribeCommand.kt +++ b/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/android/locales/AndroidLocalesDescribeCommand.kt @@ -23,6 +23,13 @@ class AndroidLocalesDescribeCommand : Runnable, DescribeAndroidLocales { + @CommandLine.Option( + names = ["-h", "--help"], + usageHelp = true, + description = ["Prints this help message"] + ) + var usageHelpRequested: Boolean = false + @CommandLine.Parameters( index = "0", arity = "1", diff --git a/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/android/versions/AndroidVersionsDescribeCommand.kt b/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/android/versions/AndroidVersionsDescribeCommand.kt index fd6187bf48..a6d215062c 100644 --- a/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/android/versions/AndroidVersionsDescribeCommand.kt +++ b/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/android/versions/AndroidVersionsDescribeCommand.kt @@ -24,6 +24,13 @@ class AndroidVersionsDescribeCommand : Runnable, DescribeAndroidVersions { + @CommandLine.Option( + names = ["-h", "--help"], + usageHelp = true, + description = ["Prints this help message"] + ) + var usageHelpRequested: Boolean = false + @CommandLine.Option( names = ["-c", "--config"], description = ["YAML config file path"] diff --git a/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/ios/IosLocalesCommand.kt b/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/ios/IosLocalesCommand.kt index 738007a718..459cf0e69e 100644 --- a/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/ios/IosLocalesCommand.kt +++ b/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/ios/IosLocalesCommand.kt @@ -17,4 +17,11 @@ import picocli.CommandLine subcommands = [IosLocalesListCommand::class, IosLocalesDescribeCommand::class], usageHelpAutoWidth = true ) -class IosLocalesCommand : PrintHelp +class IosLocalesCommand : PrintHelp { + @CommandLine.Option( + names = ["-h", "--help"], + usageHelp = true, + description = ["Prints this help message"] + ) + var usageHelpRequested: Boolean = false +} diff --git a/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/ios/IosModelsCommand.kt b/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/ios/IosModelsCommand.kt index 44af7600f8..8a2379195e 100644 --- a/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/ios/IosModelsCommand.kt +++ b/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/ios/IosModelsCommand.kt @@ -17,4 +17,11 @@ import picocli.CommandLine subcommands = [IosModelsListCommand::class, IosModelDescribeCommand::class], usageHelpAutoWidth = true ) -class IosModelsCommand : PrintHelp +class IosModelsCommand : PrintHelp { + @CommandLine.Option( + names = ["-h", "--help"], + usageHelp = true, + description = ["Prints this help message"] + ) + var usageHelpRequested: Boolean = false +} diff --git a/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/ios/IosOrientationsCommand.kt b/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/ios/IosOrientationsCommand.kt index 2afdc4f316..0be31ea7d8 100644 --- a/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/ios/IosOrientationsCommand.kt +++ b/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/ios/IosOrientationsCommand.kt @@ -16,4 +16,11 @@ import picocli.CommandLine subcommands = [IosOrientationsListCommand::class], usageHelpAutoWidth = true ) -class IosOrientationsCommand : PrintHelp +class IosOrientationsCommand : PrintHelp { + @CommandLine.Option( + names = ["-h", "--help"], + usageHelp = true, + description = ["Prints this help message"] + ) + var usageHelpRequested: Boolean = false +} diff --git a/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/ios/IosVersionsCommand.kt b/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/ios/IosVersionsCommand.kt index c758549b82..e1027da7e0 100644 --- a/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/ios/IosVersionsCommand.kt +++ b/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/ios/IosVersionsCommand.kt @@ -17,4 +17,11 @@ import picocli.CommandLine description = ["Information about available software versions. For example prints list of available software versions"], usageHelpAutoWidth = true ) -class IosVersionsCommand : PrintHelp +class IosVersionsCommand : PrintHelp { + @CommandLine.Option( + names = ["-h", "--help"], + usageHelp = true, + description = ["Prints this help message"] + ) + var usageHelpRequested: Boolean = false +} diff --git a/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/ios/configuration/IosLocalesDescribeCommand.kt b/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/ios/configuration/IosLocalesDescribeCommand.kt index 92f15e2bb3..91cb9d1ac9 100644 --- a/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/ios/configuration/IosLocalesDescribeCommand.kt +++ b/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/ios/configuration/IosLocalesDescribeCommand.kt @@ -23,6 +23,13 @@ class IosLocalesDescribeCommand : Runnable, DescribeIosLocales { + @CommandLine.Option( + names = ["-h", "--help"], + usageHelp = true, + description = ["Prints this help message"] + ) + var usageHelpRequested: Boolean = false + @CommandLine.Parameters( index = "0", arity = "1", diff --git a/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/ios/versions/IosVersionsDescribeCommand.kt b/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/ios/versions/IosVersionsDescribeCommand.kt index ed47aec83c..8290b29640 100644 --- a/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/ios/versions/IosVersionsDescribeCommand.kt +++ b/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/ios/versions/IosVersionsDescribeCommand.kt @@ -30,6 +30,13 @@ class IosVersionsDescribeCommand : ) override var configPath: String = FtlConstants.defaultIosConfig + @CommandLine.Option( + names = ["-h", "--help"], + usageHelp = true, + description = ["Prints this help message"] + ) + var usageHelpRequested: Boolean = false + @CommandLine.Parameters( index = "0", arity = "1", diff --git a/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/ipblocks/IPBlocksListCommand.kt b/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/ipblocks/IPBlocksListCommand.kt index 32cad3b969..9b11c11a60 100644 --- a/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/ipblocks/IPBlocksListCommand.kt +++ b/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/ipblocks/IPBlocksListCommand.kt @@ -21,6 +21,14 @@ import picocli.CommandLine class IPBlocksListCommand : Runnable, ListIPBlocks { + + @CommandLine.Option( + names = ["-h", "--help"], + usageHelp = true, + description = ["Prints this help message"] + ) + var usageHelpRequested: Boolean = false + override fun run() = invoke() override val out = outputLogger { diff --git a/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/networkprofiles/NetworkProfilesDescribeCommand.kt b/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/networkprofiles/NetworkProfilesDescribeCommand.kt index 34da80cd73..8d58e5acf2 100644 --- a/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/networkprofiles/NetworkProfilesDescribeCommand.kt +++ b/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/networkprofiles/NetworkProfilesDescribeCommand.kt @@ -23,6 +23,13 @@ class NetworkProfilesDescribeCommand : Runnable, DescribeNetworkProfiles { + @CommandLine.Option( + names = ["-h", "--help"], + usageHelp = true, + description = ["Prints this help message"] + ) + var usageHelpRequested: Boolean = false + @CommandLine.Parameters( index = "0", arity = "1", diff --git a/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/networkprofiles/NetworkProfilesListCommand.kt b/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/networkprofiles/NetworkProfilesListCommand.kt index 07f65ffb2b..6f9be11607 100644 --- a/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/networkprofiles/NetworkProfilesListCommand.kt +++ b/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/networkprofiles/NetworkProfilesListCommand.kt @@ -23,6 +23,14 @@ import picocli.CommandLine class NetworkProfilesListCommand : Runnable, ListNetworkProfiles { + + @CommandLine.Option( + names = ["-h", "--help"], + usageHelp = true, + description = ["Prints this help message"] + ) + var usageHelpRequested: Boolean = false + override fun run() = invoke() override val out = outputLogger { diff --git a/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/providedsoftware/ProvidedSoftwareListCommand.kt b/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/providedsoftware/ProvidedSoftwareListCommand.kt index 539fc2a30b..ceb82476ef 100644 --- a/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/providedsoftware/ProvidedSoftwareListCommand.kt +++ b/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/providedsoftware/ProvidedSoftwareListCommand.kt @@ -22,6 +22,13 @@ class ProvidedSoftwareListCommand : Runnable, ListProvidedSoftware { + @CommandLine.Option( + names = ["-h", "--help"], + usageHelp = true, + description = ["Prints this help message"] + ) + var usageHelpRequested: Boolean = false + override fun run() = invoke() override val out = outputLogger { From 0799cc76583144cb99a5c430b641f412af59048b Mon Sep 17 00:00:00 2001 From: Adam Date: Tue, 8 Jun 2021 18:10:09 +0200 Subject: [PATCH 2/7] Create CliTest.kt --- test_runner/src/test/kotlin/ftl/CliTest.kt | 28 ++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 test_runner/src/test/kotlin/ftl/CliTest.kt diff --git a/test_runner/src/test/kotlin/ftl/CliTest.kt b/test_runner/src/test/kotlin/ftl/CliTest.kt new file mode 100644 index 0000000000..fb8492e69f --- /dev/null +++ b/test_runner/src/test/kotlin/ftl/CliTest.kt @@ -0,0 +1,28 @@ +package ftl + +import ftl.presentation.cli.MainCommand +import org.junit.Test +import picocli.CommandLine + +class CliTest { + @Test + fun `all commands should contain help flags`() { + val cmd = CommandLine(MainCommand()) + val allCommands = (cmd.subcommands.values.toList().getAllSubCommands() + cmd) + allCommands.forEach { command -> + val helpCommandExist = command.commandSpec.args().mapNotNull { arg -> arg as? CommandLine.Model.OptionSpec } + .any { arg -> arg.names().contains("-h") && arg.names().contains("--help") } + + assert(helpCommandExist) { "Help flag not found in command: flank ${command.getCommandPath()}" } + } + } + + private fun CommandLine.getCommandPath(message: String = ""): String { + return if (parent != null) parent.getCommandPath("$commandName $message") + else message.trim() + } + + fun List.getAllSubCommands(): List = + if (any().not()) this + else (this + flatMap { it.subcommands.values }.getAllSubCommands()) +} From b7f7ffa13f5690e6dcbcdaaf88bdd0c6be610980 Mon Sep 17 00:00:00 2001 From: Adam Date: Wed, 9 Jun 2021 12:46:30 +0200 Subject: [PATCH 3/7] Added help flag for corelium android run, added unit test --- .../cli/RunTestCorelliumAndroidCommand.kt | 7 ++++++ test_runner/src/test/kotlin/ftl/CliTest.kt | 23 +++++++++++-------- 2 files changed, 21 insertions(+), 9 deletions(-) diff --git a/corellium/cli/src/main/kotlin/flank/corellium/cli/RunTestCorelliumAndroidCommand.kt b/corellium/cli/src/main/kotlin/flank/corellium/cli/RunTestCorelliumAndroidCommand.kt index 69bfd4db84..3f1e215623 100644 --- a/corellium/cli/src/main/kotlin/flank/corellium/cli/RunTestCorelliumAndroidCommand.kt +++ b/corellium/cli/src/main/kotlin/flank/corellium/cli/RunTestCorelliumAndroidCommand.kt @@ -50,6 +50,13 @@ class RunTestCorelliumAndroidCommand : ) var project: String? by data + @CommandLine.Option( + names = ["-h", "--help"], + usageHelp = true, + description = ["Prints this help message"] + ) + var usageHelpRequested: Boolean = false + @CommandLine.Option( names = ["--apks"], split = ";", diff --git a/test_runner/src/test/kotlin/ftl/CliTest.kt b/test_runner/src/test/kotlin/ftl/CliTest.kt index fb8492e69f..bf1f2f8d31 100644 --- a/test_runner/src/test/kotlin/ftl/CliTest.kt +++ b/test_runner/src/test/kotlin/ftl/CliTest.kt @@ -5,16 +5,16 @@ import org.junit.Test import picocli.CommandLine class CliTest { + @Test fun `all commands should contain help flags`() { val cmd = CommandLine(MainCommand()) - val allCommands = (cmd.subcommands.values.toList().getAllSubCommands() + cmd) - allCommands.forEach { command -> - val helpCommandExist = command.commandSpec.args().mapNotNull { arg -> arg as? CommandLine.Model.OptionSpec } - .any { arg -> arg.names().contains("-h") && arg.names().contains("--help") } + val allCommands = (cmd.subcommands.values.getAllSubCommands() + cmd) + val commandsWithoutHelpFlag = + allCommands + .getCommandWithoutHelp() - assert(helpCommandExist) { "Help flag not found in command: flank ${command.getCommandPath()}" } - } + assert(commandsWithoutHelpFlag.isEmpty()) { "Help flag not found in command: flank ${commandsWithoutHelpFlag.joinToString { it.getCommandPath() }}" } } private fun CommandLine.getCommandPath(message: String = ""): String { @@ -22,7 +22,12 @@ class CliTest { else message.trim() } - fun List.getAllSubCommands(): List = - if (any().not()) this - else (this + flatMap { it.subcommands.values }.getAllSubCommands()) + private fun Collection.getAllSubCommands(): Collection = + if (any()) (this + flatMap { it.subcommands.values }.getAllSubCommands()) + else this + + private fun Collection.getCommandWithoutHelp() = map { command -> + command to command.commandSpec.args().mapNotNull { arg -> arg as? CommandLine.Model.OptionSpec } + .any { arg -> arg.names().contains("-h") || arg.names().contains("--help") } + }.filter { !it.second }.map { it.first } } From cdaede1b21535c3324f6d9e19d073a14efc6bb24 Mon Sep 17 00:00:00 2001 From: Adam Date: Wed, 9 Jun 2021 12:54:23 +0200 Subject: [PATCH 4/7] Update CliTest.kt --- test_runner/src/test/kotlin/ftl/{ => cli}/CliTest.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename test_runner/src/test/kotlin/ftl/{ => cli}/CliTest.kt (98%) diff --git a/test_runner/src/test/kotlin/ftl/CliTest.kt b/test_runner/src/test/kotlin/ftl/cli/CliTest.kt similarity index 98% rename from test_runner/src/test/kotlin/ftl/CliTest.kt rename to test_runner/src/test/kotlin/ftl/cli/CliTest.kt index bf1f2f8d31..4ee2a69e4c 100644 --- a/test_runner/src/test/kotlin/ftl/CliTest.kt +++ b/test_runner/src/test/kotlin/ftl/cli/CliTest.kt @@ -1,4 +1,4 @@ -package ftl +package ftl.cli import ftl.presentation.cli.MainCommand import org.junit.Test From 560ee557b3ce5ee893382079ca2d630dc8b3cf6d Mon Sep 17 00:00:00 2001 From: Adam Date: Wed, 9 Jun 2021 13:16:54 +0200 Subject: [PATCH 5/7] updated tests --- .../main/kotlin/ftl/presentation/cli/AuthCommand.kt | 10 +--------- .../kotlin/ftl/presentation/cli/CorelliumCommand.kt | 10 +--------- .../kotlin/ftl/presentation/cli/FirebaseCommand.kt | 10 +--------- .../ftl/presentation/cli/corellium/TestCommand.kt | 10 +--------- .../presentation/cli/corellium/test/AndroidCommand.kt | 10 +--------- .../ftl/presentation/cli/firebase/TestCommand.kt | 10 +--------- .../presentation/cli/firebase/test/AndroidCommand.kt | 10 +--------- .../presentation/cli/firebase/test/IPBlocksCommand.kt | 9 +-------- .../ftl/presentation/cli/firebase/test/IosCommand.kt | 10 +--------- .../cli/firebase/test/NetworkProfilesCommand.kt | 9 +-------- .../cli/firebase/test/ProvidedSoftwareCommand.kt | 9 +-------- .../cli/firebase/test/android/AndroidLocalesCommand.kt | 9 +-------- .../cli/firebase/test/android/AndroidModelsCommand.kt | 9 +-------- .../test/android/AndroidOrientationsCommand.kt | 9 +-------- .../firebase/test/android/AndroidVersionsCommand.kt | 9 +-------- .../cli/firebase/test/ios/IosLocalesCommand.kt | 9 +-------- .../cli/firebase/test/ios/IosModelsCommand.kt | 9 +-------- .../cli/firebase/test/ios/IosOrientationsCommand.kt | 9 +-------- .../cli/firebase/test/ios/IosVersionsCommand.kt | 9 +-------- test_runner/src/main/kotlin/ftl/util/PrintHelp.kt | 8 +++++++- test_runner/src/test/kotlin/ftl/MainTest.kt | 3 ++- test_runner/src/test/kotlin/ftl/cli/AuthCommandTest.kt | 3 ++- .../src/test/kotlin/ftl/cli/FirebaseCommandTest.kt | 3 ++- .../test/kotlin/ftl/cli/firebase/TestCommandTest.kt | 3 ++- .../ftl/cli/firebase/test/IPBlocksCommandTest.kt | 3 ++- .../cli/firebase/test/NetworkProfilesCommandTest.kt | 3 ++- 26 files changed, 38 insertions(+), 167 deletions(-) diff --git a/test_runner/src/main/kotlin/ftl/presentation/cli/AuthCommand.kt b/test_runner/src/main/kotlin/ftl/presentation/cli/AuthCommand.kt index 8143631cc0..4614d578cf 100644 --- a/test_runner/src/main/kotlin/ftl/presentation/cli/AuthCommand.kt +++ b/test_runner/src/main/kotlin/ftl/presentation/cli/AuthCommand.kt @@ -2,7 +2,6 @@ package ftl.presentation.cli import ftl.presentation.cli.auth.LoginCommand import ftl.util.PrintHelp -import picocli.CommandLine import picocli.CommandLine.Command @Command( @@ -14,11 +13,4 @@ import picocli.CommandLine.Command ], usageHelpAutoWidth = true ) -class AuthCommand : PrintHelp { - @CommandLine.Option( - names = ["-h", "--help"], - usageHelp = true, - description = ["Prints this help message"] - ) - var usageHelpRequested: Boolean = false -} +class AuthCommand : PrintHelp() diff --git a/test_runner/src/main/kotlin/ftl/presentation/cli/CorelliumCommand.kt b/test_runner/src/main/kotlin/ftl/presentation/cli/CorelliumCommand.kt index 0d1fdc580c..292a85212b 100644 --- a/test_runner/src/main/kotlin/ftl/presentation/cli/CorelliumCommand.kt +++ b/test_runner/src/main/kotlin/ftl/presentation/cli/CorelliumCommand.kt @@ -2,7 +2,6 @@ package ftl.presentation.cli import ftl.presentation.cli.corellium.TestCommand import ftl.util.PrintHelp -import picocli.CommandLine import picocli.CommandLine.Command @Command( @@ -13,11 +12,4 @@ import picocli.CommandLine.Command ], usageHelpAutoWidth = true ) -class CorelliumCommand : PrintHelp { - @CommandLine.Option( - names = ["-h", "--help"], - usageHelp = true, - description = ["Prints this help message"] - ) - var usageHelpRequested: Boolean = false -} +class CorelliumCommand : PrintHelp() diff --git a/test_runner/src/main/kotlin/ftl/presentation/cli/FirebaseCommand.kt b/test_runner/src/main/kotlin/ftl/presentation/cli/FirebaseCommand.kt index bd7cebe6cb..6815a8dfd3 100644 --- a/test_runner/src/main/kotlin/ftl/presentation/cli/FirebaseCommand.kt +++ b/test_runner/src/main/kotlin/ftl/presentation/cli/FirebaseCommand.kt @@ -4,7 +4,6 @@ import ftl.presentation.cli.firebase.CancelCommand import ftl.presentation.cli.firebase.RefreshCommand import ftl.presentation.cli.firebase.TestCommand import ftl.util.PrintHelp -import picocli.CommandLine import picocli.CommandLine.Command @Command( @@ -17,11 +16,4 @@ import picocli.CommandLine.Command ], usageHelpAutoWidth = true ) -class FirebaseCommand : PrintHelp { - @CommandLine.Option( - names = ["-h", "--help"], - usageHelp = true, - description = ["Prints this help message"] - ) - var usageHelpRequested: Boolean = false -} +class FirebaseCommand : PrintHelp() diff --git a/test_runner/src/main/kotlin/ftl/presentation/cli/corellium/TestCommand.kt b/test_runner/src/main/kotlin/ftl/presentation/cli/corellium/TestCommand.kt index eb0066309e..7c131abf9c 100644 --- a/test_runner/src/main/kotlin/ftl/presentation/cli/corellium/TestCommand.kt +++ b/test_runner/src/main/kotlin/ftl/presentation/cli/corellium/TestCommand.kt @@ -2,7 +2,6 @@ package ftl.presentation.cli.corellium import ftl.presentation.cli.corellium.test.AndroidCommand import ftl.util.PrintHelp -import picocli.CommandLine import picocli.CommandLine.Command @Command( @@ -13,11 +12,4 @@ import picocli.CommandLine.Command ], usageHelpAutoWidth = true ) -class TestCommand : PrintHelp { - @CommandLine.Option( - names = ["-h", "--help"], - usageHelp = true, - description = ["Prints this help message"] - ) - var usageHelpRequested: Boolean = false -} +class TestCommand : PrintHelp() diff --git a/test_runner/src/main/kotlin/ftl/presentation/cli/corellium/test/AndroidCommand.kt b/test_runner/src/main/kotlin/ftl/presentation/cli/corellium/test/AndroidCommand.kt index 39bb98b68b..e631efbc39 100644 --- a/test_runner/src/main/kotlin/ftl/presentation/cli/corellium/test/AndroidCommand.kt +++ b/test_runner/src/main/kotlin/ftl/presentation/cli/corellium/test/AndroidCommand.kt @@ -2,7 +2,6 @@ package ftl.presentation.cli.corellium.test import flank.corellium.cli.RunTestCorelliumAndroidCommand import ftl.util.PrintHelp -import picocli.CommandLine import picocli.CommandLine.Command @Command( @@ -13,11 +12,4 @@ import picocli.CommandLine.Command ], usageHelpAutoWidth = true ) -class AndroidCommand : PrintHelp { - @CommandLine.Option( - names = ["-h", "--help"], - usageHelp = true, - description = ["Prints this help message"] - ) - var usageHelpRequested: Boolean = false -} +class AndroidCommand : PrintHelp() diff --git a/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/TestCommand.kt b/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/TestCommand.kt index 1ab648331d..a0f8f75f77 100644 --- a/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/TestCommand.kt +++ b/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/TestCommand.kt @@ -6,7 +6,6 @@ import ftl.presentation.cli.firebase.test.IosCommand import ftl.presentation.cli.firebase.test.NetworkProfilesCommand import ftl.presentation.cli.firebase.test.ProvidedSoftwareCommand import ftl.util.PrintHelp -import picocli.CommandLine import picocli.CommandLine.Command @Command( @@ -21,11 +20,4 @@ import picocli.CommandLine.Command ], usageHelpAutoWidth = true ) -class TestCommand : PrintHelp { - @CommandLine.Option( - names = ["-h", "--help"], - usageHelp = true, - description = ["Prints this help message"] - ) - var usageHelpRequested: Boolean = false -} +class TestCommand : PrintHelp() diff --git a/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/AndroidCommand.kt b/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/AndroidCommand.kt index 8367812068..543e9ee925 100644 --- a/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/AndroidCommand.kt +++ b/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/AndroidCommand.kt @@ -8,7 +8,6 @@ import ftl.presentation.cli.firebase.test.android.AndroidRunCommand import ftl.presentation.cli.firebase.test.android.AndroidTestEnvironmentCommand import ftl.presentation.cli.firebase.test.android.AndroidVersionsCommand import ftl.util.PrintHelp -import picocli.CommandLine import picocli.CommandLine.Command @Command( @@ -25,11 +24,4 @@ import picocli.CommandLine.Command ], usageHelpAutoWidth = true ) -class AndroidCommand : PrintHelp { - @CommandLine.Option( - names = ["-h", "--help"], - usageHelp = true, - description = ["Prints this help message"] - ) - var usageHelpRequested: Boolean = false -} +class AndroidCommand : PrintHelp() diff --git a/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/IPBlocksCommand.kt b/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/IPBlocksCommand.kt index 9bc2d146c1..3fce5c0469 100644 --- a/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/IPBlocksCommand.kt +++ b/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/IPBlocksCommand.kt @@ -11,11 +11,4 @@ import picocli.CommandLine header = ["Explore IP blocks used by Firebase Test Lab devices."], usageHelpAutoWidth = true ) -class IPBlocksCommand : PrintHelp { - @CommandLine.Option( - names = ["-h", "--help"], - usageHelp = true, - description = ["Prints this help message"] - ) - var usageHelpRequested: Boolean = false -} +class IPBlocksCommand : PrintHelp() diff --git a/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/IosCommand.kt b/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/IosCommand.kt index c39f76367a..5e4a7938fc 100644 --- a/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/IosCommand.kt +++ b/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/IosCommand.kt @@ -8,7 +8,6 @@ import ftl.presentation.cli.firebase.test.ios.IosRunCommand import ftl.presentation.cli.firebase.test.ios.IosTestEnvironmentCommand import ftl.presentation.cli.firebase.test.ios.IosVersionsCommand import ftl.util.PrintHelp -import picocli.CommandLine import picocli.CommandLine.Command @Command( @@ -25,11 +24,4 @@ import picocli.CommandLine.Command ], usageHelpAutoWidth = true ) -class IosCommand : PrintHelp { - @CommandLine.Option( - names = ["-h", "--help"], - usageHelp = true, - description = ["Prints this help message"] - ) - var usageHelpRequested: Boolean = false -} +class IosCommand : PrintHelp() diff --git a/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/NetworkProfilesCommand.kt b/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/NetworkProfilesCommand.kt index 94f6b46691..b863849923 100644 --- a/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/NetworkProfilesCommand.kt +++ b/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/NetworkProfilesCommand.kt @@ -15,11 +15,4 @@ import picocli.CommandLine header = ["Explore network profiles available for testing."], usageHelpAutoWidth = true ) -class NetworkProfilesCommand : PrintHelp { - @CommandLine.Option( - names = ["-h", "--help"], - usageHelp = true, - description = ["Prints this help message"] - ) - var usageHelpRequested: Boolean = false -} +class NetworkProfilesCommand : PrintHelp() diff --git a/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/ProvidedSoftwareCommand.kt b/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/ProvidedSoftwareCommand.kt index d3b73d5dd6..65669165f9 100644 --- a/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/ProvidedSoftwareCommand.kt +++ b/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/ProvidedSoftwareCommand.kt @@ -12,11 +12,4 @@ import picocli.CommandLine ], usageHelpAutoWidth = true ) -class ProvidedSoftwareCommand : PrintHelp { - @CommandLine.Option( - names = ["-h", "--help"], - usageHelp = true, - description = ["Prints this help message"] - ) - var usageHelpRequested: Boolean = false -} +class ProvidedSoftwareCommand : PrintHelp() diff --git a/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/android/AndroidLocalesCommand.kt b/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/android/AndroidLocalesCommand.kt index 439f3a454c..5c0e02ce5d 100644 --- a/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/android/AndroidLocalesCommand.kt +++ b/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/android/AndroidLocalesCommand.kt @@ -17,11 +17,4 @@ import picocli.CommandLine subcommands = [AndroidLocalesListCommand::class, AndroidLocalesDescribeCommand::class], usageHelpAutoWidth = true ) -class AndroidLocalesCommand : PrintHelp { - @CommandLine.Option( - names = ["-h", "--help"], - usageHelp = true, - description = ["Prints this help message"] - ) - var usageHelpRequested: Boolean = false -} +class AndroidLocalesCommand : PrintHelp() diff --git a/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/android/AndroidModelsCommand.kt b/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/android/AndroidModelsCommand.kt index e10d6a7a77..b01a08af67 100644 --- a/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/android/AndroidModelsCommand.kt +++ b/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/android/AndroidModelsCommand.kt @@ -17,11 +17,4 @@ import picocli.CommandLine subcommands = [AndroidModelsListCommand::class, AndroidModelDescribeCommand::class], usageHelpAutoWidth = true ) -class AndroidModelsCommand : PrintHelp { - @CommandLine.Option( - names = ["-h", "--help"], - usageHelp = true, - description = ["Prints this help message"] - ) - var usageHelpRequested: Boolean = false -} +class AndroidModelsCommand : PrintHelp() diff --git a/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/android/AndroidOrientationsCommand.kt b/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/android/AndroidOrientationsCommand.kt index b82d624035..d6d35aba7f 100644 --- a/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/android/AndroidOrientationsCommand.kt +++ b/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/android/AndroidOrientationsCommand.kt @@ -16,11 +16,4 @@ import picocli.CommandLine subcommands = [AndroidOrientationsListCommand::class], usageHelpAutoWidth = true ) -class AndroidOrientationsCommand : PrintHelp { - @CommandLine.Option( - names = ["-h", "--help"], - usageHelp = true, - description = ["Prints this help message"] - ) - var usageHelpRequested: Boolean = false -} +class AndroidOrientationsCommand : PrintHelp() diff --git a/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/android/AndroidVersionsCommand.kt b/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/android/AndroidVersionsCommand.kt index e62f6244b2..8f17a727c0 100644 --- a/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/android/AndroidVersionsCommand.kt +++ b/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/android/AndroidVersionsCommand.kt @@ -17,11 +17,4 @@ import picocli.CommandLine subcommands = [AndroidVersionsListCommand::class, AndroidVersionsDescribeCommand::class], usageHelpAutoWidth = true ) -class AndroidVersionsCommand : PrintHelp { - @CommandLine.Option( - names = ["-h", "--help"], - usageHelp = true, - description = ["Prints this help message"] - ) - var usageHelpRequested: Boolean = false -} +class AndroidVersionsCommand : PrintHelp() diff --git a/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/ios/IosLocalesCommand.kt b/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/ios/IosLocalesCommand.kt index 459cf0e69e..43452d9927 100644 --- a/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/ios/IosLocalesCommand.kt +++ b/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/ios/IosLocalesCommand.kt @@ -17,11 +17,4 @@ import picocli.CommandLine subcommands = [IosLocalesListCommand::class, IosLocalesDescribeCommand::class], usageHelpAutoWidth = true ) -class IosLocalesCommand : PrintHelp { - @CommandLine.Option( - names = ["-h", "--help"], - usageHelp = true, - description = ["Prints this help message"] - ) - var usageHelpRequested: Boolean = false -} +class IosLocalesCommand : PrintHelp() diff --git a/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/ios/IosModelsCommand.kt b/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/ios/IosModelsCommand.kt index 8a2379195e..46032721c3 100644 --- a/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/ios/IosModelsCommand.kt +++ b/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/ios/IosModelsCommand.kt @@ -17,11 +17,4 @@ import picocli.CommandLine subcommands = [IosModelsListCommand::class, IosModelDescribeCommand::class], usageHelpAutoWidth = true ) -class IosModelsCommand : PrintHelp { - @CommandLine.Option( - names = ["-h", "--help"], - usageHelp = true, - description = ["Prints this help message"] - ) - var usageHelpRequested: Boolean = false -} +class IosModelsCommand : PrintHelp() diff --git a/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/ios/IosOrientationsCommand.kt b/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/ios/IosOrientationsCommand.kt index 0be31ea7d8..cac31503cd 100644 --- a/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/ios/IosOrientationsCommand.kt +++ b/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/ios/IosOrientationsCommand.kt @@ -16,11 +16,4 @@ import picocli.CommandLine subcommands = [IosOrientationsListCommand::class], usageHelpAutoWidth = true ) -class IosOrientationsCommand : PrintHelp { - @CommandLine.Option( - names = ["-h", "--help"], - usageHelp = true, - description = ["Prints this help message"] - ) - var usageHelpRequested: Boolean = false -} +class IosOrientationsCommand : PrintHelp() diff --git a/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/ios/IosVersionsCommand.kt b/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/ios/IosVersionsCommand.kt index e1027da7e0..769ec63e82 100644 --- a/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/ios/IosVersionsCommand.kt +++ b/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/ios/IosVersionsCommand.kt @@ -17,11 +17,4 @@ import picocli.CommandLine description = ["Information about available software versions. For example prints list of available software versions"], usageHelpAutoWidth = true ) -class IosVersionsCommand : PrintHelp { - @CommandLine.Option( - names = ["-h", "--help"], - usageHelp = true, - description = ["Prints this help message"] - ) - var usageHelpRequested: Boolean = false -} +class IosVersionsCommand : PrintHelp() diff --git a/test_runner/src/main/kotlin/ftl/util/PrintHelp.kt b/test_runner/src/main/kotlin/ftl/util/PrintHelp.kt index bc4f1b02a0..5cffa8083c 100644 --- a/test_runner/src/main/kotlin/ftl/util/PrintHelp.kt +++ b/test_runner/src/main/kotlin/ftl/util/PrintHelp.kt @@ -2,8 +2,14 @@ package ftl.util import picocli.CommandLine -interface PrintHelp : Runnable { +abstract class PrintHelp : Runnable { override fun run() { CommandLine.usage(this, System.out) } + @CommandLine.Option( + names = ["-h", "--help"], + usageHelp = true, + description = ["Prints this help message"] + ) + var usageHelpRequested: Boolean = false } diff --git a/test_runner/src/test/kotlin/ftl/MainTest.kt b/test_runner/src/test/kotlin/ftl/MainTest.kt index 4133f01c2f..171905bdcf 100644 --- a/test_runner/src/test/kotlin/ftl/MainTest.kt +++ b/test_runner/src/test/kotlin/ftl/MainTest.kt @@ -32,8 +32,9 @@ class MainTest { private fun assertMainHelpStrings(output: String) { assertThat(output.normalizeLineEnding()).contains( "flank.jar\n" + - " [-v] [--debug] [COMMAND]\n" + + " [-hv] [--debug] [COMMAND]\n" + " --debug Enables debug logging\n" + + " -h, --help Prints this help message\n" + " -v, --version Prints the version\n" + "Commands:\n" + " firebase\n" + diff --git a/test_runner/src/test/kotlin/ftl/cli/AuthCommandTest.kt b/test_runner/src/test/kotlin/ftl/cli/AuthCommandTest.kt index fd54b565e8..3916d29754 100644 --- a/test_runner/src/test/kotlin/ftl/cli/AuthCommandTest.kt +++ b/test_runner/src/test/kotlin/ftl/cli/AuthCommandTest.kt @@ -21,7 +21,8 @@ class AuthCommandTest { val output = systemOutRule.log.normalizeLineEnding() assertThat(output).startsWith( "Manage oauth2 credentials for Google Cloud\n\n" + - "auth [COMMAND]\n" + + "auth [-h] [COMMAND]\n" + + " -h, --help Prints this help message\n" + "Commands:\n" + " login" ) diff --git a/test_runner/src/test/kotlin/ftl/cli/FirebaseCommandTest.kt b/test_runner/src/test/kotlin/ftl/cli/FirebaseCommandTest.kt index 79ccdcebb7..c8b8ae4ceb 100644 --- a/test_runner/src/test/kotlin/ftl/cli/FirebaseCommandTest.kt +++ b/test_runner/src/test/kotlin/ftl/cli/FirebaseCommandTest.kt @@ -20,7 +20,8 @@ class FirebaseCommandTest { FirebaseCommand().run() val output = systemOutRule.log.normalizeLineEnding() assertThat(output).startsWith( - "firebase [COMMAND]\n" + + "firebase [-h] [COMMAND]\n" + + " -h, --help Prints this help message\n" + "Commands:\n" + " test\n" + " refresh Downloads results for the last Firebase Test Lab run\n" + diff --git a/test_runner/src/test/kotlin/ftl/cli/firebase/TestCommandTest.kt b/test_runner/src/test/kotlin/ftl/cli/firebase/TestCommandTest.kt index 2a91d1141c..43dc88ad40 100644 --- a/test_runner/src/test/kotlin/ftl/cli/firebase/TestCommandTest.kt +++ b/test_runner/src/test/kotlin/ftl/cli/firebase/TestCommandTest.kt @@ -20,7 +20,8 @@ class TestCommandTest { TestCommand().run() val output = systemOutRule.log.normalizeLineEnding() assertThat(output).startsWith( - "test [COMMAND]\n" + + "test [-h] [COMMAND]\n" + + " -h, --help Prints this help message\n" + "Commands:\n" + " android\n" + " ios\n" diff --git a/test_runner/src/test/kotlin/ftl/cli/firebase/test/IPBlocksCommandTest.kt b/test_runner/src/test/kotlin/ftl/cli/firebase/test/IPBlocksCommandTest.kt index 76e8697bc5..bbe793d9ea 100644 --- a/test_runner/src/test/kotlin/ftl/cli/firebase/test/IPBlocksCommandTest.kt +++ b/test_runner/src/test/kotlin/ftl/cli/firebase/test/IPBlocksCommandTest.kt @@ -17,7 +17,8 @@ class IPBlocksCommandTest { val expected = """ Explore IP blocks used by Firebase Test Lab devices. -ip-blocks [COMMAND] +ip-blocks [-h] [COMMAND] + -h, --help Prints this help message Commands: list List all IP address blocks used by Firebase Test Lab devices """.trimIndent() diff --git a/test_runner/src/test/kotlin/ftl/cli/firebase/test/NetworkProfilesCommandTest.kt b/test_runner/src/test/kotlin/ftl/cli/firebase/test/NetworkProfilesCommandTest.kt index 14fd20cd52..d03512b4ab 100644 --- a/test_runner/src/test/kotlin/ftl/cli/firebase/test/NetworkProfilesCommandTest.kt +++ b/test_runner/src/test/kotlin/ftl/cli/firebase/test/NetworkProfilesCommandTest.kt @@ -19,7 +19,8 @@ class NetworkProfilesCommandTest { val expected = listOf( "Explore network profiles available for testing.", - "network-profiles [COMMAND]", + "network-profiles [-h] [COMMAND]", + " -h, --help Prints this help message", "Commands:", " list List all network profiles available for testing", " describe Describe a network profile", From 42d59ddbdf2a63199143237c23e56c4b76489468 Mon Sep 17 00:00:00 2001 From: Adam Date: Wed, 9 Jun 2021 13:34:26 +0200 Subject: [PATCH 6/7] Move help arg to base class --- .../main/kotlin/ftl/presentation/cli/MainCommand.kt | 10 ++-------- .../kotlin/ftl/presentation/cli/auth/LoginCommand.kt | 10 ++-------- .../ftl/presentation/cli/firebase/CancelCommand.kt | 10 ++-------- .../ftl/presentation/cli/firebase/RefreshCommand.kt | 11 ++--------- .../cli/firebase/test/CommonRunCommand.kt | 10 ++-------- .../cli/firebase/test/android/AndroidDoctorCommand.kt | 10 ++-------- .../test/android/AndroidTestEnvironmentCommand.kt | 10 ++-------- .../android/locales/AndroidLocalesDescribeCommand.kt | 10 ++-------- .../test/android/locales/AndroidLocalesListCommand.kt | 10 ++-------- .../android/models/AndroidModelDescribeCommand.kt | 10 ++-------- .../test/android/models/AndroidModelsListCommand.kt | 10 ++-------- .../orientations/AndroidOrientationsListCommand.kt | 10 ++-------- .../versions/AndroidVersionsDescribeCommand.kt | 10 ++-------- .../android/versions/AndroidVersionsListCommand.kt | 10 ++-------- .../cli/firebase/test/ios/IosDoctorCommand.kt | 10 ++-------- .../firebase/test/ios/IosTestEnvironmentCommand.kt | 10 ++-------- .../ios/configuration/IosLocalesDescribeCommand.kt | 10 ++-------- .../test/ios/configuration/IosLocalesListCommand.kt | 10 ++-------- .../test/ios/models/IosModelDescribeCommand.kt | 10 ++-------- .../firebase/test/ios/models/IosModelsListCommand.kt | 10 ++-------- .../ios/orientations/IosOrientationsListCommand.kt | 10 ++-------- .../test/ios/versions/IosVersionsDescribeCommand.kt | 10 ++-------- .../test/ios/versions/IosVersionsListCommand.kt | 10 ++-------- .../cli/firebase/test/ipblocks/IPBlocksListCommand.kt | 10 ++-------- .../networkprofiles/NetworkProfilesDescribeCommand.kt | 10 ++-------- .../networkprofiles/NetworkProfilesListCommand.kt | 10 ++-------- .../providedsoftware/ProvidedSoftwareListCommand.kt | 10 ++-------- 27 files changed, 54 insertions(+), 217 deletions(-) diff --git a/test_runner/src/main/kotlin/ftl/presentation/cli/MainCommand.kt b/test_runner/src/main/kotlin/ftl/presentation/cli/MainCommand.kt index c6af0865d9..dedd4a72f4 100644 --- a/test_runner/src/main/kotlin/ftl/presentation/cli/MainCommand.kt +++ b/test_runner/src/main/kotlin/ftl/presentation/cli/MainCommand.kt @@ -8,6 +8,7 @@ import ftl.presentation.cli.firebase.test.IPBlocksCommand import ftl.presentation.cli.firebase.test.IosCommand import ftl.presentation.cli.firebase.test.NetworkProfilesCommand import ftl.presentation.cli.firebase.test.ProvidedSoftwareCommand +import ftl.util.PrintHelp import ftl.util.printVersionInfo import picocli.CommandLine @@ -27,7 +28,7 @@ import picocli.CommandLine IPBlocksCommand::class ] ) -class MainCommand : Runnable { +class MainCommand : PrintHelp() { @CommandLine.Option( names = ["-v", "--version"], @@ -35,13 +36,6 @@ class MainCommand : Runnable { ) private var printVersion = false - @CommandLine.Option( - names = ["-h", "--help"], - usageHelp = true, - description = ["Prints this help message"] - ) - var usageHelpRequested: Boolean = false - @CommandLine.Option( names = ["--debug"], description = ["Enables debug logging"], diff --git a/test_runner/src/main/kotlin/ftl/presentation/cli/auth/LoginCommand.kt b/test_runner/src/main/kotlin/ftl/presentation/cli/auth/LoginCommand.kt index 51fb7f1443..09e3098a46 100644 --- a/test_runner/src/main/kotlin/ftl/presentation/cli/auth/LoginCommand.kt +++ b/test_runner/src/main/kotlin/ftl/presentation/cli/auth/LoginCommand.kt @@ -2,6 +2,7 @@ package ftl.presentation.cli.auth import ftl.domain.LoginGoogleAccount import ftl.domain.invoke +import ftl.util.PrintHelp import picocli.CommandLine @CommandLine.Command( @@ -17,15 +18,8 @@ import picocli.CommandLine usageHelpAutoWidth = true ) class LoginCommand : - Runnable, + PrintHelp(), LoginGoogleAccount { - @CommandLine.Option( - names = ["-h", "--help"], - usageHelp = true, - description = ["Prints this help message"] - ) - var usageHelpRequested: Boolean = false - override fun run() = invoke() } diff --git a/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/CancelCommand.kt b/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/CancelCommand.kt index 094eddb858..6503de87e4 100644 --- a/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/CancelCommand.kt +++ b/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/CancelCommand.kt @@ -5,6 +5,7 @@ import ftl.domain.invoke import ftl.presentation.outputLogger import ftl.presentation.throwUnknownType import ftl.run.MatrixCancelStatus +import ftl.util.PrintHelp import picocli.CommandLine @CommandLine.Command( @@ -24,16 +25,9 @@ Reads in the matrix_ids.json file. Cancels any incomplete matrices. usageHelpAutoWidth = true ) class CancelCommand : - Runnable, + PrintHelp(), CancelLastRun { - @CommandLine.Option( - names = ["-h", "--help"], - usageHelp = true, - description = ["Prints this help message"] - ) - var usageHelpRequested: Boolean = false - override fun run() = invoke() override val out = outputLogger { diff --git a/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/RefreshCommand.kt b/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/RefreshCommand.kt index 43c5d97266..db1c84a822 100644 --- a/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/RefreshCommand.kt +++ b/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/RefreshCommand.kt @@ -2,9 +2,9 @@ package ftl.presentation.cli.firebase import ftl.domain.RefreshLastRun import ftl.domain.invoke +import ftl.util.PrintHelp import kotlinx.coroutines.runBlocking import picocli.CommandLine.Command -import picocli.CommandLine.Option @Command( name = "refresh", @@ -23,15 +23,8 @@ Reads in the matrix_ids.json file. Refreshes any incomplete matrices. usageHelpAutoWidth = true ) class RefreshCommand : - Runnable, + PrintHelp(), RefreshLastRun { - @Option( - names = ["-h", "--help"], - usageHelp = true, - description = ["Prints this help message"] - ) - var usageHelpRequested: Boolean = false - override fun run() = runBlocking { invoke() } } diff --git a/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/CommonRunCommand.kt b/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/CommonRunCommand.kt index 52f82be622..53f468f888 100644 --- a/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/CommonRunCommand.kt +++ b/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/CommonRunCommand.kt @@ -6,9 +6,10 @@ import ftl.config.asDevice import ftl.config.common.CommonFlankConfig import ftl.config.common.CommonGcloudConfig import ftl.config.common.addDevice +import ftl.util.PrintHelp import picocli.CommandLine -abstract class CommonRunCommand : Runnable { +abstract class CommonRunCommand : PrintHelp() { @CommandLine.Mixin private val commonGcloudConfig = CommonGcloudConfig() @@ -23,13 +24,6 @@ abstract class CommonRunCommand : Runnable { abstract val config: Config.Platform<*, *> - @CommandLine.Option( - names = ["-h", "--help"], - usageHelp = true, - description = ["Prints this help message"] - ) - var usageHelpRequested: Boolean = false - // Gcloud @CommandLine.Option( names = ["--device"], diff --git a/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/android/AndroidDoctorCommand.kt b/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/android/AndroidDoctorCommand.kt index fd349de054..93e7c2d316 100644 --- a/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/android/AndroidDoctorCommand.kt +++ b/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/android/AndroidDoctorCommand.kt @@ -7,6 +7,7 @@ import ftl.domain.invoke import ftl.presentation.cli.firebase.test.summary import ftl.presentation.outputLogger import ftl.presentation.throwUnknownType +import ftl.util.PrintHelp import picocli.CommandLine.Command import picocli.CommandLine.Option @@ -26,16 +27,9 @@ import picocli.CommandLine.Option usageHelpAutoWidth = true ) class AndroidDoctorCommand : - Runnable, + PrintHelp(), RunDoctor { - @Option( - names = ["-h", "--help"], - usageHelp = true, - description = ["Prints this help message"] - ) - var usageHelpRequested: Boolean = false - @Option( names = ["-c", "--config"], description = ["YAML config file path"] diff --git a/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/android/AndroidTestEnvironmentCommand.kt b/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/android/AndroidTestEnvironmentCommand.kt index bdf113a884..cb60628efc 100644 --- a/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/android/AndroidTestEnvironmentCommand.kt +++ b/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/android/AndroidTestEnvironmentCommand.kt @@ -7,6 +7,7 @@ import ftl.domain.invoke import ftl.presentation.cli.firebase.test.environment.prepareOutputString import ftl.presentation.outputLogger import ftl.presentation.throwUnknownType +import ftl.util.PrintHelp import picocli.CommandLine @CommandLine.Command( @@ -27,7 +28,7 @@ import picocli.CommandLine usageHelpAutoWidth = true ) class AndroidTestEnvironmentCommand : - Runnable, + PrintHelp(), DescribeAndroidTestEnvironment { @CommandLine.Option( @@ -36,13 +37,6 @@ class AndroidTestEnvironmentCommand : ) override var configPath: String = FtlConstants.defaultAndroidConfig - @CommandLine.Option( - names = ["-h", "--help"], - usageHelp = true, - description = ["Prints this help message"] - ) - var usageHelpRequested: Boolean = false - override fun run() = invoke() override val out = outputLogger { diff --git a/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/android/locales/AndroidLocalesDescribeCommand.kt b/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/android/locales/AndroidLocalesDescribeCommand.kt index c9a8031fd1..410b267072 100644 --- a/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/android/locales/AndroidLocalesDescribeCommand.kt +++ b/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/android/locales/AndroidLocalesDescribeCommand.kt @@ -7,6 +7,7 @@ import ftl.domain.invoke import ftl.presentation.cli.firebase.test.locale.prepareDescription import ftl.presentation.outputLogger import ftl.presentation.throwUnknownType +import ftl.util.PrintHelp import picocli.CommandLine @CommandLine.Command( @@ -20,16 +21,9 @@ import picocli.CommandLine usageHelpAutoWidth = true ) class AndroidLocalesDescribeCommand : - Runnable, + PrintHelp(), DescribeAndroidLocales { - @CommandLine.Option( - names = ["-h", "--help"], - usageHelp = true, - description = ["Prints this help message"] - ) - var usageHelpRequested: Boolean = false - @CommandLine.Parameters( index = "0", arity = "1", diff --git a/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/android/locales/AndroidLocalesListCommand.kt b/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/android/locales/AndroidLocalesListCommand.kt index ef13ec2aaa..6aeb8b2d20 100644 --- a/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/android/locales/AndroidLocalesListCommand.kt +++ b/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/android/locales/AndroidLocalesListCommand.kt @@ -7,6 +7,7 @@ import ftl.domain.invoke import ftl.presentation.cli.firebase.test.locale.toCliTable import ftl.presentation.outputLogger import ftl.presentation.throwUnknownType +import ftl.util.PrintHelp import ftl.util.asListOrNull import picocli.CommandLine @@ -22,7 +23,7 @@ import picocli.CommandLine usageHelpAutoWidth = true ) class AndroidLocalesListCommand : - Runnable, + PrintHelp(), ListAndroidLocales { @CommandLine.Option( @@ -31,13 +32,6 @@ class AndroidLocalesListCommand : ) override var configPath: String = FtlConstants.defaultAndroidConfig - @CommandLine.Option( - names = ["-h", "--help"], - usageHelp = true, - description = ["Prints this help message"] - ) - var usageHelpRequested: Boolean = false - override fun run() = invoke() override val out = outputLogger { diff --git a/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/android/models/AndroidModelDescribeCommand.kt b/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/android/models/AndroidModelDescribeCommand.kt index bc27366f2a..dbf979390d 100644 --- a/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/android/models/AndroidModelDescribeCommand.kt +++ b/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/android/models/AndroidModelDescribeCommand.kt @@ -7,6 +7,7 @@ import ftl.domain.invoke import ftl.presentation.cli.firebase.test.android.models.describe.prepareDescription import ftl.presentation.outputLogger import ftl.presentation.throwUnknownType +import ftl.util.PrintHelp import picocli.CommandLine @CommandLine.Command( @@ -20,16 +21,9 @@ import picocli.CommandLine usageHelpAutoWidth = true ) class AndroidModelDescribeCommand : - Runnable, + PrintHelp(), DescribeAndroidModels { - @CommandLine.Option( - names = ["-h", "--help"], - usageHelp = true, - description = ["Prints this help message"] - ) - var usageHelpRequested: Boolean = false - @CommandLine.Option( names = ["-c", "--config"], description = ["YAML config file path"] diff --git a/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/android/models/AndroidModelsListCommand.kt b/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/android/models/AndroidModelsListCommand.kt index 4af9a28831..4b6df2eb34 100644 --- a/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/android/models/AndroidModelsListCommand.kt +++ b/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/android/models/AndroidModelsListCommand.kt @@ -7,6 +7,7 @@ import ftl.domain.invoke import ftl.environment.android.toCliTable import ftl.presentation.outputLogger import ftl.presentation.throwUnknownType +import ftl.util.PrintHelp import picocli.CommandLine @CommandLine.Command( @@ -21,7 +22,7 @@ import picocli.CommandLine usageHelpAutoWidth = true ) class AndroidModelsListCommand : - Runnable, + PrintHelp(), ListAndroidModels { @CommandLine.Option( @@ -36,12 +37,5 @@ class AndroidModelsListCommand : } } - @CommandLine.Option( - names = ["-h", "--help"], - usageHelp = true, - description = ["Prints this help message"] - ) - var usageHelpRequested: Boolean = false - override fun run() = invoke() } diff --git a/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/android/orientations/AndroidOrientationsListCommand.kt b/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/android/orientations/AndroidOrientationsListCommand.kt index 684ed99753..e1906b3ebc 100644 --- a/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/android/orientations/AndroidOrientationsListCommand.kt +++ b/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/android/orientations/AndroidOrientationsListCommand.kt @@ -6,6 +6,7 @@ import ftl.domain.ListAndroidOrientations import ftl.domain.invoke import ftl.presentation.outputLogger import ftl.presentation.throwUnknownType +import ftl.util.PrintHelp import ftl.util.asListOrNull import picocli.CommandLine @@ -21,7 +22,7 @@ import picocli.CommandLine usageHelpAutoWidth = true ) class AndroidOrientationsListCommand : - Runnable, + PrintHelp(), ListAndroidOrientations { @CommandLine.Option( @@ -30,13 +31,6 @@ class AndroidOrientationsListCommand : ) override var configPath: String = FtlConstants.defaultAndroidConfig - @CommandLine.Option( - names = ["-h", "--help"], - usageHelp = true, - description = ["Prints this help message"] - ) - var usageHelpRequested: Boolean = false - override fun run() = invoke() override val out = outputLogger { diff --git a/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/android/versions/AndroidVersionsDescribeCommand.kt b/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/android/versions/AndroidVersionsDescribeCommand.kt index a6d215062c..a4125f8ce0 100644 --- a/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/android/versions/AndroidVersionsDescribeCommand.kt +++ b/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/android/versions/AndroidVersionsDescribeCommand.kt @@ -7,6 +7,7 @@ import ftl.domain.invoke import ftl.environment.android.prepareDescription import ftl.presentation.outputLogger import ftl.presentation.throwUnknownType +import ftl.util.PrintHelp import picocli.CommandLine @CommandLine.Command( @@ -21,16 +22,9 @@ import picocli.CommandLine usageHelpAutoWidth = true ) class AndroidVersionsDescribeCommand : - Runnable, + PrintHelp(), DescribeAndroidVersions { - @CommandLine.Option( - names = ["-h", "--help"], - usageHelp = true, - description = ["Prints this help message"] - ) - var usageHelpRequested: Boolean = false - @CommandLine.Option( names = ["-c", "--config"], description = ["YAML config file path"] diff --git a/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/android/versions/AndroidVersionsListCommand.kt b/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/android/versions/AndroidVersionsListCommand.kt index c4c8eadef3..d3fd03a19c 100644 --- a/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/android/versions/AndroidVersionsListCommand.kt +++ b/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/android/versions/AndroidVersionsListCommand.kt @@ -6,6 +6,7 @@ import ftl.domain.ListAndroidVersions import ftl.domain.invoke import ftl.presentation.outputLogger import ftl.presentation.throwUnknownType +import ftl.util.PrintHelp import ftl.util.asListOrNull import picocli.CommandLine @@ -21,7 +22,7 @@ import picocli.CommandLine usageHelpAutoWidth = true ) class AndroidVersionsListCommand : - Runnable, + PrintHelp(), ListAndroidVersions { @CommandLine.Option( @@ -34,12 +35,5 @@ class AndroidVersionsListCommand : asListOrNull()?.toCliTable() ?: throwUnknownType() } - @CommandLine.Option( - names = ["-h", "--help"], - usageHelp = true, - description = ["Prints this help message"] - ) - var usageHelpRequested: Boolean = false - override fun run() = invoke() } diff --git a/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/ios/IosDoctorCommand.kt b/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/ios/IosDoctorCommand.kt index d767fe7c91..0843a3e7cd 100644 --- a/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/ios/IosDoctorCommand.kt +++ b/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/ios/IosDoctorCommand.kt @@ -7,6 +7,7 @@ import ftl.domain.invoke import ftl.presentation.cli.firebase.test.summary import ftl.presentation.outputLogger import ftl.presentation.throwUnknownType +import ftl.util.PrintHelp import picocli.CommandLine.Command import picocli.CommandLine.Option @@ -26,16 +27,9 @@ import picocli.CommandLine.Option usageHelpAutoWidth = true ) class IosDoctorCommand : - Runnable, + PrintHelp(), RunDoctor { - @Option( - names = ["-h", "--help"], - usageHelp = true, - description = ["Prints this help message"] - ) - var usageHelpRequested: Boolean = false - @Option( names = ["-c", "--config"], description = ["YAML config file path"] diff --git a/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/ios/IosTestEnvironmentCommand.kt b/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/ios/IosTestEnvironmentCommand.kt index 16d55450c8..fa29932fc7 100644 --- a/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/ios/IosTestEnvironmentCommand.kt +++ b/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/ios/IosTestEnvironmentCommand.kt @@ -7,6 +7,7 @@ import ftl.domain.invoke import ftl.presentation.cli.firebase.test.environment.prepareOutputString import ftl.presentation.outputLogger import ftl.presentation.throwUnknownType +import ftl.util.PrintHelp import picocli.CommandLine @CommandLine.Command( @@ -27,7 +28,7 @@ import picocli.CommandLine usageHelpAutoWidth = true ) class IosTestEnvironmentCommand : - Runnable, + PrintHelp(), DescribeIosTestEnvironment { @CommandLine.Option( @@ -36,13 +37,6 @@ class IosTestEnvironmentCommand : ) override var configPath: String = FtlConstants.defaultIosConfig - @CommandLine.Option( - names = ["-h", "--help"], - usageHelp = true, - description = ["Prints this help message"] - ) - var usageHelpRequested: Boolean = false - override fun run() = invoke() override val out = outputLogger { diff --git a/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/ios/configuration/IosLocalesDescribeCommand.kt b/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/ios/configuration/IosLocalesDescribeCommand.kt index 91cb9d1ac9..8dd287b9c0 100644 --- a/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/ios/configuration/IosLocalesDescribeCommand.kt +++ b/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/ios/configuration/IosLocalesDescribeCommand.kt @@ -7,6 +7,7 @@ import ftl.domain.invoke import ftl.presentation.cli.firebase.test.locale.prepareDescription import ftl.presentation.outputLogger import ftl.presentation.throwUnknownType +import ftl.util.PrintHelp import picocli.CommandLine @CommandLine.Command( @@ -20,16 +21,9 @@ import picocli.CommandLine usageHelpAutoWidth = true ) class IosLocalesDescribeCommand : - Runnable, + PrintHelp(), DescribeIosLocales { - @CommandLine.Option( - names = ["-h", "--help"], - usageHelp = true, - description = ["Prints this help message"] - ) - var usageHelpRequested: Boolean = false - @CommandLine.Parameters( index = "0", arity = "1", diff --git a/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/ios/configuration/IosLocalesListCommand.kt b/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/ios/configuration/IosLocalesListCommand.kt index c7d0891e95..fdc3b261ef 100644 --- a/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/ios/configuration/IosLocalesListCommand.kt +++ b/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/ios/configuration/IosLocalesListCommand.kt @@ -7,6 +7,7 @@ import ftl.domain.invoke import ftl.presentation.cli.firebase.test.locale.toCliTable import ftl.presentation.outputLogger import ftl.presentation.throwUnknownType +import ftl.util.PrintHelp import ftl.util.asListOrNull import picocli.CommandLine @@ -22,7 +23,7 @@ import picocli.CommandLine usageHelpAutoWidth = true ) class IosLocalesListCommand : - Runnable, + PrintHelp(), ListIosLocales { @CommandLine.Option( @@ -31,13 +32,6 @@ class IosLocalesListCommand : ) override var configPath: String = FtlConstants.defaultIosConfig - @CommandLine.Option( - names = ["-h", "--help"], - usageHelp = true, - description = ["Prints this help message"] - ) - var usageHelpRequested: Boolean = false - override fun run() = invoke() override val out = outputLogger { diff --git a/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/ios/models/IosModelDescribeCommand.kt b/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/ios/models/IosModelDescribeCommand.kt index e82c5c6337..d851806c65 100644 --- a/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/ios/models/IosModelDescribeCommand.kt +++ b/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/ios/models/IosModelDescribeCommand.kt @@ -7,6 +7,7 @@ import ftl.domain.invoke import ftl.presentation.cli.firebase.test.ios.models.describe.prepareDescription import ftl.presentation.outputLogger import ftl.presentation.throwUnknownType +import ftl.util.PrintHelp import picocli.CommandLine @CommandLine.Command( @@ -20,7 +21,7 @@ import picocli.CommandLine usageHelpAutoWidth = true ) class IosModelDescribeCommand : - Runnable, + PrintHelp(), DescribeIosModels { @CommandLine.Option( @@ -41,13 +42,6 @@ class IosModelDescribeCommand : ) override var modelId: String = "" - @CommandLine.Option( - names = ["-h", "--help"], - usageHelp = true, - description = ["Prints this help message"] - ) - var usageHelpRequested: Boolean = false - override fun run() = invoke() override val out = outputLogger { diff --git a/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/ios/models/IosModelsListCommand.kt b/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/ios/models/IosModelsListCommand.kt index 0ca40da1dd..4fec279f1d 100644 --- a/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/ios/models/IosModelsListCommand.kt +++ b/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/ios/models/IosModelsListCommand.kt @@ -7,6 +7,7 @@ import ftl.domain.invoke import ftl.environment.ios.toCliTable import ftl.presentation.outputLogger import ftl.presentation.throwUnknownType +import ftl.util.PrintHelp import picocli.CommandLine @CommandLine.Command( @@ -21,7 +22,7 @@ import picocli.CommandLine usageHelpAutoWidth = true ) class IosModelsListCommand : - Runnable, + PrintHelp(), ListIosModels { @CommandLine.Option( @@ -37,12 +38,5 @@ class IosModelsListCommand : } } - @CommandLine.Option( - names = ["-h", "--help"], - usageHelp = true, - description = ["Prints this help message"] - ) - var usageHelpRequested: Boolean = false - override fun run() = invoke() } diff --git a/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/ios/orientations/IosOrientationsListCommand.kt b/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/ios/orientations/IosOrientationsListCommand.kt index 4739eccabe..05e638cdc8 100644 --- a/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/ios/orientations/IosOrientationsListCommand.kt +++ b/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/ios/orientations/IosOrientationsListCommand.kt @@ -8,6 +8,7 @@ import ftl.presentation.cli.firebase.test.android.orientations.toCliTable import ftl.presentation.cli.firebase.test.locale.toCliTable import ftl.presentation.outputLogger import ftl.presentation.throwUnknownType +import ftl.util.PrintHelp import ftl.util.asListOrNull import picocli.CommandLine @@ -23,7 +24,7 @@ import picocli.CommandLine usageHelpAutoWidth = true ) class IosOrientationsListCommand : - Runnable, + PrintHelp(), ListIosOrientations { @CommandLine.Option( @@ -32,13 +33,6 @@ class IosOrientationsListCommand : ) override var configPath: String = FtlConstants.defaultIosConfig - @CommandLine.Option( - names = ["-h", "--help"], - usageHelp = true, - description = ["Prints this help message"] - ) - var usageHelpRequested: Boolean = false - override fun run() = invoke() override val out = outputLogger { diff --git a/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/ios/versions/IosVersionsDescribeCommand.kt b/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/ios/versions/IosVersionsDescribeCommand.kt index 8290b29640..cc02092ef0 100644 --- a/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/ios/versions/IosVersionsDescribeCommand.kt +++ b/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/ios/versions/IosVersionsDescribeCommand.kt @@ -7,6 +7,7 @@ import ftl.domain.invoke import ftl.presentation.cli.firebase.test.ios.models.describe.prepareDescription import ftl.presentation.outputLogger import ftl.presentation.throwUnknownType +import ftl.util.PrintHelp import picocli.CommandLine @CommandLine.Command( @@ -21,7 +22,7 @@ import picocli.CommandLine usageHelpAutoWidth = true ) class IosVersionsDescribeCommand : - Runnable, + PrintHelp(), DescribeIosVersions { @CommandLine.Option( @@ -30,13 +31,6 @@ class IosVersionsDescribeCommand : ) override var configPath: String = FtlConstants.defaultIosConfig - @CommandLine.Option( - names = ["-h", "--help"], - usageHelp = true, - description = ["Prints this help message"] - ) - var usageHelpRequested: Boolean = false - @CommandLine.Parameters( index = "0", arity = "1", diff --git a/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/ios/versions/IosVersionsListCommand.kt b/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/ios/versions/IosVersionsListCommand.kt index b5d03ce309..7f079ae5fa 100644 --- a/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/ios/versions/IosVersionsListCommand.kt +++ b/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/ios/versions/IosVersionsListCommand.kt @@ -7,6 +7,7 @@ import ftl.domain.invoke import ftl.environment.ios.toCliTable import ftl.presentation.outputLogger import ftl.presentation.throwUnknownType +import ftl.util.PrintHelp import picocli.CommandLine @CommandLine.Command( @@ -21,7 +22,7 @@ import picocli.CommandLine usageHelpAutoWidth = true ) class IosVersionsListCommand : - Runnable, + PrintHelp(), ListIosVersions { @CommandLine.Option( @@ -30,13 +31,6 @@ class IosVersionsListCommand : ) override var configPath: String = FtlConstants.defaultIosConfig - @CommandLine.Option( - names = ["-h", "--help"], - usageHelp = true, - description = ["Prints this help message"] - ) - var usageHelpRequested: Boolean = false - override fun run() = invoke() override val out = outputLogger { diff --git a/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/ipblocks/IPBlocksListCommand.kt b/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/ipblocks/IPBlocksListCommand.kt index 9b11c11a60..9833966a61 100644 --- a/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/ipblocks/IPBlocksListCommand.kt +++ b/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/ipblocks/IPBlocksListCommand.kt @@ -5,6 +5,7 @@ import ftl.domain.ListIPBlocks import ftl.domain.invoke import ftl.presentation.outputLogger import ftl.presentation.throwUnknownType +import ftl.util.PrintHelp import picocli.CommandLine @CommandLine.Command( @@ -19,16 +20,9 @@ import picocli.CommandLine usageHelpAutoWidth = true ) class IPBlocksListCommand : - Runnable, + PrintHelp(), ListIPBlocks { - @CommandLine.Option( - names = ["-h", "--help"], - usageHelp = true, - description = ["Prints this help message"] - ) - var usageHelpRequested: Boolean = false - override fun run() = invoke() override val out = outputLogger { diff --git a/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/networkprofiles/NetworkProfilesDescribeCommand.kt b/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/networkprofiles/NetworkProfilesDescribeCommand.kt index 8d58e5acf2..82062c4dcb 100644 --- a/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/networkprofiles/NetworkProfilesDescribeCommand.kt +++ b/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/networkprofiles/NetworkProfilesDescribeCommand.kt @@ -6,6 +6,7 @@ import ftl.domain.invoke import ftl.environment.prepareDescription import ftl.presentation.outputLogger import ftl.presentation.throwUnknownType +import ftl.util.PrintHelp import picocli.CommandLine @CommandLine.Command( @@ -20,16 +21,9 @@ import picocli.CommandLine usageHelpAutoWidth = true ) class NetworkProfilesDescribeCommand : - Runnable, + PrintHelp(), DescribeNetworkProfiles { - @CommandLine.Option( - names = ["-h", "--help"], - usageHelp = true, - description = ["Prints this help message"] - ) - var usageHelpRequested: Boolean = false - @CommandLine.Parameters( index = "0", arity = "1", diff --git a/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/networkprofiles/NetworkProfilesListCommand.kt b/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/networkprofiles/NetworkProfilesListCommand.kt index 6f9be11607..beb7493316 100644 --- a/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/networkprofiles/NetworkProfilesListCommand.kt +++ b/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/networkprofiles/NetworkProfilesListCommand.kt @@ -5,6 +5,7 @@ import ftl.domain.ListNetworkProfiles import ftl.domain.invoke import ftl.presentation.outputLogger import ftl.presentation.throwUnknownType +import ftl.util.PrintHelp import ftl.util.asList import ftl.util.asListOrNull import picocli.CommandLine @@ -21,16 +22,9 @@ import picocli.CommandLine usageHelpAutoWidth = true ) class NetworkProfilesListCommand : - Runnable, + PrintHelp(), ListNetworkProfiles { - @CommandLine.Option( - names = ["-h", "--help"], - usageHelp = true, - description = ["Prints this help message"] - ) - var usageHelpRequested: Boolean = false - override fun run() = invoke() override val out = outputLogger { diff --git a/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/providedsoftware/ProvidedSoftwareListCommand.kt b/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/providedsoftware/ProvidedSoftwareListCommand.kt index ceb82476ef..36f3568fc6 100644 --- a/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/providedsoftware/ProvidedSoftwareListCommand.kt +++ b/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/providedsoftware/ProvidedSoftwareListCommand.kt @@ -5,6 +5,7 @@ import ftl.domain.ListProvidedSoftware import ftl.domain.invoke import ftl.presentation.outputLogger import ftl.presentation.throwUnknownType +import ftl.util.PrintHelp import picocli.CommandLine @CommandLine.Command( @@ -19,16 +20,9 @@ import picocli.CommandLine usageHelpAutoWidth = true ) class ProvidedSoftwareListCommand : - Runnable, + PrintHelp(), ListProvidedSoftware { - @CommandLine.Option( - names = ["-h", "--help"], - usageHelp = true, - description = ["Prints this help message"] - ) - var usageHelpRequested: Boolean = false - override fun run() = invoke() override val out = outputLogger { From d333495915094b9bd446908fe40aacd620df77e3 Mon Sep 17 00:00:00 2001 From: Adam Date: Wed, 9 Jun 2021 16:31:43 +0200 Subject: [PATCH 7/7] cr changes --- .../src/main/kotlin/ftl/presentation/cli/AuthCommand.kt | 4 ++-- .../src/main/kotlin/ftl/presentation/cli/CorelliumCommand.kt | 4 ++-- .../src/main/kotlin/ftl/presentation/cli/FirebaseCommand.kt | 4 ++-- .../src/main/kotlin/ftl/presentation/cli/MainCommand.kt | 4 ++-- .../main/kotlin/ftl/presentation/cli/auth/LoginCommand.kt | 4 ++-- .../kotlin/ftl/presentation/cli/corellium/TestCommand.kt | 4 ++-- .../ftl/presentation/cli/corellium/test/AndroidCommand.kt | 4 ++-- .../kotlin/ftl/presentation/cli/firebase/CancelCommand.kt | 4 ++-- .../kotlin/ftl/presentation/cli/firebase/RefreshCommand.kt | 4 ++-- .../main/kotlin/ftl/presentation/cli/firebase/TestCommand.kt | 4 ++-- .../ftl/presentation/cli/firebase/test/AndroidCommand.kt | 4 ++-- .../ftl/presentation/cli/firebase/test/CommonRunCommand.kt | 4 ++-- .../ftl/presentation/cli/firebase/test/IPBlocksCommand.kt | 4 ++-- .../kotlin/ftl/presentation/cli/firebase/test/IosCommand.kt | 4 ++-- .../presentation/cli/firebase/test/NetworkProfilesCommand.kt | 4 ++-- .../cli/firebase/test/ProvidedSoftwareCommand.kt | 4 ++-- .../cli/firebase/test/android/AndroidDoctorCommand.kt | 4 ++-- .../cli/firebase/test/android/AndroidLocalesCommand.kt | 4 ++-- .../cli/firebase/test/android/AndroidModelsCommand.kt | 4 ++-- .../cli/firebase/test/android/AndroidOrientationsCommand.kt | 4 ++-- .../firebase/test/android/AndroidTestEnvironmentCommand.kt | 4 ++-- .../cli/firebase/test/android/AndroidVersionsCommand.kt | 4 ++-- .../test/android/locales/AndroidLocalesDescribeCommand.kt | 4 ++-- .../test/android/locales/AndroidLocalesListCommand.kt | 4 ++-- .../test/android/models/AndroidModelDescribeCommand.kt | 4 ++-- .../firebase/test/android/models/AndroidModelsListCommand.kt | 4 ++-- .../android/orientations/AndroidOrientationsListCommand.kt | 4 ++-- .../test/android/versions/AndroidVersionsDescribeCommand.kt | 4 ++-- .../test/android/versions/AndroidVersionsListCommand.kt | 4 ++-- .../presentation/cli/firebase/test/ios/IosDoctorCommand.kt | 4 ++-- .../presentation/cli/firebase/test/ios/IosLocalesCommand.kt | 4 ++-- .../presentation/cli/firebase/test/ios/IosModelsCommand.kt | 4 ++-- .../cli/firebase/test/ios/IosOrientationsCommand.kt | 4 ++-- .../cli/firebase/test/ios/IosTestEnvironmentCommand.kt | 4 ++-- .../presentation/cli/firebase/test/ios/IosVersionsCommand.kt | 4 ++-- .../test/ios/configuration/IosLocalesDescribeCommand.kt | 4 ++-- .../firebase/test/ios/configuration/IosLocalesListCommand.kt | 4 ++-- .../cli/firebase/test/ios/models/IosModelDescribeCommand.kt | 4 ++-- .../cli/firebase/test/ios/models/IosModelsListCommand.kt | 4 ++-- .../test/ios/orientations/IosOrientationsListCommand.kt | 5 ++--- .../firebase/test/ios/versions/IosVersionsDescribeCommand.kt | 4 ++-- .../cli/firebase/test/ios/versions/IosVersionsListCommand.kt | 4 ++-- .../cli/firebase/test/ipblocks/IPBlocksListCommand.kt | 4 ++-- .../test/networkprofiles/NetworkProfilesDescribeCommand.kt | 4 ++-- .../test/networkprofiles/NetworkProfilesListCommand.kt | 4 ++-- .../test/providedsoftware/ProvidedSoftwareListCommand.kt | 4 ++-- .../kotlin/ftl/util/{PrintHelp.kt => PrintHelpCommand.kt} | 2 +- test_runner/src/test/kotlin/ftl/cli/CliTest.kt | 2 +- 48 files changed, 94 insertions(+), 95 deletions(-) rename test_runner/src/main/kotlin/ftl/util/{PrintHelp.kt => PrintHelpCommand.kt} (87%) diff --git a/test_runner/src/main/kotlin/ftl/presentation/cli/AuthCommand.kt b/test_runner/src/main/kotlin/ftl/presentation/cli/AuthCommand.kt index 4614d578cf..755e744619 100644 --- a/test_runner/src/main/kotlin/ftl/presentation/cli/AuthCommand.kt +++ b/test_runner/src/main/kotlin/ftl/presentation/cli/AuthCommand.kt @@ -1,7 +1,7 @@ package ftl.presentation.cli import ftl.presentation.cli.auth.LoginCommand -import ftl.util.PrintHelp +import ftl.util.PrintHelpCommand import picocli.CommandLine.Command @Command( @@ -13,4 +13,4 @@ import picocli.CommandLine.Command ], usageHelpAutoWidth = true ) -class AuthCommand : PrintHelp() +class AuthCommand : PrintHelpCommand() diff --git a/test_runner/src/main/kotlin/ftl/presentation/cli/CorelliumCommand.kt b/test_runner/src/main/kotlin/ftl/presentation/cli/CorelliumCommand.kt index 292a85212b..3fad5d10f9 100644 --- a/test_runner/src/main/kotlin/ftl/presentation/cli/CorelliumCommand.kt +++ b/test_runner/src/main/kotlin/ftl/presentation/cli/CorelliumCommand.kt @@ -1,7 +1,7 @@ package ftl.presentation.cli import ftl.presentation.cli.corellium.TestCommand -import ftl.util.PrintHelp +import ftl.util.PrintHelpCommand import picocli.CommandLine.Command @Command( @@ -12,4 +12,4 @@ import picocli.CommandLine.Command ], usageHelpAutoWidth = true ) -class CorelliumCommand : PrintHelp() +class CorelliumCommand : PrintHelpCommand() diff --git a/test_runner/src/main/kotlin/ftl/presentation/cli/FirebaseCommand.kt b/test_runner/src/main/kotlin/ftl/presentation/cli/FirebaseCommand.kt index 6815a8dfd3..2471fae542 100644 --- a/test_runner/src/main/kotlin/ftl/presentation/cli/FirebaseCommand.kt +++ b/test_runner/src/main/kotlin/ftl/presentation/cli/FirebaseCommand.kt @@ -3,7 +3,7 @@ package ftl.presentation.cli import ftl.presentation.cli.firebase.CancelCommand import ftl.presentation.cli.firebase.RefreshCommand import ftl.presentation.cli.firebase.TestCommand -import ftl.util.PrintHelp +import ftl.util.PrintHelpCommand import picocli.CommandLine.Command @Command( @@ -16,4 +16,4 @@ import picocli.CommandLine.Command ], usageHelpAutoWidth = true ) -class FirebaseCommand : PrintHelp() +class FirebaseCommand : PrintHelpCommand() diff --git a/test_runner/src/main/kotlin/ftl/presentation/cli/MainCommand.kt b/test_runner/src/main/kotlin/ftl/presentation/cli/MainCommand.kt index dedd4a72f4..2ea07872aa 100644 --- a/test_runner/src/main/kotlin/ftl/presentation/cli/MainCommand.kt +++ b/test_runner/src/main/kotlin/ftl/presentation/cli/MainCommand.kt @@ -8,7 +8,7 @@ import ftl.presentation.cli.firebase.test.IPBlocksCommand import ftl.presentation.cli.firebase.test.IosCommand import ftl.presentation.cli.firebase.test.NetworkProfilesCommand import ftl.presentation.cli.firebase.test.ProvidedSoftwareCommand -import ftl.util.PrintHelp +import ftl.util.PrintHelpCommand import ftl.util.printVersionInfo import picocli.CommandLine @@ -28,7 +28,7 @@ import picocli.CommandLine IPBlocksCommand::class ] ) -class MainCommand : PrintHelp() { +class MainCommand : PrintHelpCommand() { @CommandLine.Option( names = ["-v", "--version"], diff --git a/test_runner/src/main/kotlin/ftl/presentation/cli/auth/LoginCommand.kt b/test_runner/src/main/kotlin/ftl/presentation/cli/auth/LoginCommand.kt index 09e3098a46..ce220380ea 100644 --- a/test_runner/src/main/kotlin/ftl/presentation/cli/auth/LoginCommand.kt +++ b/test_runner/src/main/kotlin/ftl/presentation/cli/auth/LoginCommand.kt @@ -2,7 +2,7 @@ package ftl.presentation.cli.auth import ftl.domain.LoginGoogleAccount import ftl.domain.invoke -import ftl.util.PrintHelp +import ftl.util.PrintHelpCommand import picocli.CommandLine @CommandLine.Command( @@ -18,7 +18,7 @@ import picocli.CommandLine usageHelpAutoWidth = true ) class LoginCommand : - PrintHelp(), + PrintHelpCommand(), LoginGoogleAccount { override fun run() = invoke() diff --git a/test_runner/src/main/kotlin/ftl/presentation/cli/corellium/TestCommand.kt b/test_runner/src/main/kotlin/ftl/presentation/cli/corellium/TestCommand.kt index 7c131abf9c..3beb82a41f 100644 --- a/test_runner/src/main/kotlin/ftl/presentation/cli/corellium/TestCommand.kt +++ b/test_runner/src/main/kotlin/ftl/presentation/cli/corellium/TestCommand.kt @@ -1,7 +1,7 @@ package ftl.presentation.cli.corellium import ftl.presentation.cli.corellium.test.AndroidCommand -import ftl.util.PrintHelp +import ftl.util.PrintHelpCommand import picocli.CommandLine.Command @Command( @@ -12,4 +12,4 @@ import picocli.CommandLine.Command ], usageHelpAutoWidth = true ) -class TestCommand : PrintHelp() +class TestCommand : PrintHelpCommand() diff --git a/test_runner/src/main/kotlin/ftl/presentation/cli/corellium/test/AndroidCommand.kt b/test_runner/src/main/kotlin/ftl/presentation/cli/corellium/test/AndroidCommand.kt index e631efbc39..89f6ee3988 100644 --- a/test_runner/src/main/kotlin/ftl/presentation/cli/corellium/test/AndroidCommand.kt +++ b/test_runner/src/main/kotlin/ftl/presentation/cli/corellium/test/AndroidCommand.kt @@ -1,7 +1,7 @@ package ftl.presentation.cli.corellium.test import flank.corellium.cli.RunTestCorelliumAndroidCommand -import ftl.util.PrintHelp +import ftl.util.PrintHelpCommand import picocli.CommandLine.Command @Command( @@ -12,4 +12,4 @@ import picocli.CommandLine.Command ], usageHelpAutoWidth = true ) -class AndroidCommand : PrintHelp() +class AndroidCommand : PrintHelpCommand() diff --git a/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/CancelCommand.kt b/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/CancelCommand.kt index 6503de87e4..b1f14f36b5 100644 --- a/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/CancelCommand.kt +++ b/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/CancelCommand.kt @@ -5,7 +5,7 @@ import ftl.domain.invoke import ftl.presentation.outputLogger import ftl.presentation.throwUnknownType import ftl.run.MatrixCancelStatus -import ftl.util.PrintHelp +import ftl.util.PrintHelpCommand import picocli.CommandLine @CommandLine.Command( @@ -25,7 +25,7 @@ Reads in the matrix_ids.json file. Cancels any incomplete matrices. usageHelpAutoWidth = true ) class CancelCommand : - PrintHelp(), + PrintHelpCommand(), CancelLastRun { override fun run() = invoke() diff --git a/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/RefreshCommand.kt b/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/RefreshCommand.kt index db1c84a822..851eddc70b 100644 --- a/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/RefreshCommand.kt +++ b/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/RefreshCommand.kt @@ -2,7 +2,7 @@ package ftl.presentation.cli.firebase import ftl.domain.RefreshLastRun import ftl.domain.invoke -import ftl.util.PrintHelp +import ftl.util.PrintHelpCommand import kotlinx.coroutines.runBlocking import picocli.CommandLine.Command @@ -23,7 +23,7 @@ Reads in the matrix_ids.json file. Refreshes any incomplete matrices. usageHelpAutoWidth = true ) class RefreshCommand : - PrintHelp(), + PrintHelpCommand(), RefreshLastRun { override fun run() = runBlocking { invoke() } diff --git a/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/TestCommand.kt b/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/TestCommand.kt index a0f8f75f77..7326cd0ac8 100644 --- a/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/TestCommand.kt +++ b/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/TestCommand.kt @@ -5,7 +5,7 @@ import ftl.presentation.cli.firebase.test.IPBlocksCommand import ftl.presentation.cli.firebase.test.IosCommand import ftl.presentation.cli.firebase.test.NetworkProfilesCommand import ftl.presentation.cli.firebase.test.ProvidedSoftwareCommand -import ftl.util.PrintHelp +import ftl.util.PrintHelpCommand import picocli.CommandLine.Command @Command( @@ -20,4 +20,4 @@ import picocli.CommandLine.Command ], usageHelpAutoWidth = true ) -class TestCommand : PrintHelp() +class TestCommand : PrintHelpCommand() diff --git a/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/AndroidCommand.kt b/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/AndroidCommand.kt index 543e9ee925..8be82cd316 100644 --- a/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/AndroidCommand.kt +++ b/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/AndroidCommand.kt @@ -7,7 +7,7 @@ import ftl.presentation.cli.firebase.test.android.AndroidOrientationsCommand import ftl.presentation.cli.firebase.test.android.AndroidRunCommand import ftl.presentation.cli.firebase.test.android.AndroidTestEnvironmentCommand import ftl.presentation.cli.firebase.test.android.AndroidVersionsCommand -import ftl.util.PrintHelp +import ftl.util.PrintHelpCommand import picocli.CommandLine.Command @Command( @@ -24,4 +24,4 @@ import picocli.CommandLine.Command ], usageHelpAutoWidth = true ) -class AndroidCommand : PrintHelp() +class AndroidCommand : PrintHelpCommand() diff --git a/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/CommonRunCommand.kt b/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/CommonRunCommand.kt index 53f468f888..93fff8670d 100644 --- a/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/CommonRunCommand.kt +++ b/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/CommonRunCommand.kt @@ -6,10 +6,10 @@ import ftl.config.asDevice import ftl.config.common.CommonFlankConfig import ftl.config.common.CommonGcloudConfig import ftl.config.common.addDevice -import ftl.util.PrintHelp +import ftl.util.PrintHelpCommand import picocli.CommandLine -abstract class CommonRunCommand : PrintHelp() { +abstract class CommonRunCommand : PrintHelpCommand() { @CommandLine.Mixin private val commonGcloudConfig = CommonGcloudConfig() diff --git a/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/IPBlocksCommand.kt b/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/IPBlocksCommand.kt index 3fce5c0469..9e65681b02 100644 --- a/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/IPBlocksCommand.kt +++ b/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/IPBlocksCommand.kt @@ -1,7 +1,7 @@ package ftl.presentation.cli.firebase.test import ftl.presentation.cli.firebase.test.ipblocks.IPBlocksListCommand -import ftl.util.PrintHelp +import ftl.util.PrintHelpCommand import picocli.CommandLine @CommandLine.Command( @@ -11,4 +11,4 @@ import picocli.CommandLine header = ["Explore IP blocks used by Firebase Test Lab devices."], usageHelpAutoWidth = true ) -class IPBlocksCommand : PrintHelp() +class IPBlocksCommand : PrintHelpCommand() diff --git a/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/IosCommand.kt b/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/IosCommand.kt index 5e4a7938fc..1c8ecd42ce 100644 --- a/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/IosCommand.kt +++ b/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/IosCommand.kt @@ -7,7 +7,7 @@ import ftl.presentation.cli.firebase.test.ios.IosOrientationsCommand import ftl.presentation.cli.firebase.test.ios.IosRunCommand import ftl.presentation.cli.firebase.test.ios.IosTestEnvironmentCommand import ftl.presentation.cli.firebase.test.ios.IosVersionsCommand -import ftl.util.PrintHelp +import ftl.util.PrintHelpCommand import picocli.CommandLine.Command @Command( @@ -24,4 +24,4 @@ import picocli.CommandLine.Command ], usageHelpAutoWidth = true ) -class IosCommand : PrintHelp() +class IosCommand : PrintHelpCommand() diff --git a/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/NetworkProfilesCommand.kt b/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/NetworkProfilesCommand.kt index b863849923..39b71823e5 100644 --- a/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/NetworkProfilesCommand.kt +++ b/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/NetworkProfilesCommand.kt @@ -2,7 +2,7 @@ package ftl.presentation.cli.firebase.test import ftl.presentation.cli.firebase.test.networkprofiles.NetworkProfilesDescribeCommand import ftl.presentation.cli.firebase.test.networkprofiles.NetworkProfilesListCommand -import ftl.util.PrintHelp +import ftl.util.PrintHelpCommand import picocli.CommandLine @CommandLine.Command( @@ -15,4 +15,4 @@ import picocli.CommandLine header = ["Explore network profiles available for testing."], usageHelpAutoWidth = true ) -class NetworkProfilesCommand : PrintHelp() +class NetworkProfilesCommand : PrintHelpCommand() diff --git a/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/ProvidedSoftwareCommand.kt b/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/ProvidedSoftwareCommand.kt index 65669165f9..3b52e3263c 100644 --- a/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/ProvidedSoftwareCommand.kt +++ b/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/ProvidedSoftwareCommand.kt @@ -1,7 +1,7 @@ package ftl.presentation.cli.firebase.test import ftl.presentation.cli.firebase.test.providedsoftware.ProvidedSoftwareListCommand -import ftl.util.PrintHelp +import ftl.util.PrintHelpCommand import picocli.CommandLine @CommandLine.Command( @@ -12,4 +12,4 @@ import picocli.CommandLine ], usageHelpAutoWidth = true ) -class ProvidedSoftwareCommand : PrintHelp() +class ProvidedSoftwareCommand : PrintHelpCommand() diff --git a/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/android/AndroidDoctorCommand.kt b/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/android/AndroidDoctorCommand.kt index 93e7c2d316..0fc73ca728 100644 --- a/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/android/AndroidDoctorCommand.kt +++ b/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/android/AndroidDoctorCommand.kt @@ -7,7 +7,7 @@ import ftl.domain.invoke import ftl.presentation.cli.firebase.test.summary import ftl.presentation.outputLogger import ftl.presentation.throwUnknownType -import ftl.util.PrintHelp +import ftl.util.PrintHelpCommand import picocli.CommandLine.Command import picocli.CommandLine.Option @@ -27,7 +27,7 @@ import picocli.CommandLine.Option usageHelpAutoWidth = true ) class AndroidDoctorCommand : - PrintHelp(), + PrintHelpCommand(), RunDoctor { @Option( diff --git a/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/android/AndroidLocalesCommand.kt b/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/android/AndroidLocalesCommand.kt index 5c0e02ce5d..aebc768490 100644 --- a/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/android/AndroidLocalesCommand.kt +++ b/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/android/AndroidLocalesCommand.kt @@ -2,7 +2,7 @@ package ftl.presentation.cli.firebase.test.android import ftl.presentation.cli.firebase.test.android.locales.AndroidLocalesDescribeCommand import ftl.presentation.cli.firebase.test.android.locales.AndroidLocalesListCommand -import ftl.util.PrintHelp +import ftl.util.PrintHelpCommand import picocli.CommandLine @CommandLine.Command( @@ -17,4 +17,4 @@ import picocli.CommandLine subcommands = [AndroidLocalesListCommand::class, AndroidLocalesDescribeCommand::class], usageHelpAutoWidth = true ) -class AndroidLocalesCommand : PrintHelp() +class AndroidLocalesCommand : PrintHelpCommand() diff --git a/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/android/AndroidModelsCommand.kt b/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/android/AndroidModelsCommand.kt index b01a08af67..ec1e7a06c7 100644 --- a/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/android/AndroidModelsCommand.kt +++ b/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/android/AndroidModelsCommand.kt @@ -2,7 +2,7 @@ package ftl.presentation.cli.firebase.test.android import ftl.presentation.cli.firebase.test.android.models.AndroidModelDescribeCommand import ftl.presentation.cli.firebase.test.android.models.AndroidModelsListCommand -import ftl.util.PrintHelp +import ftl.util.PrintHelpCommand import picocli.CommandLine @CommandLine.Command( @@ -17,4 +17,4 @@ import picocli.CommandLine subcommands = [AndroidModelsListCommand::class, AndroidModelDescribeCommand::class], usageHelpAutoWidth = true ) -class AndroidModelsCommand : PrintHelp() +class AndroidModelsCommand : PrintHelpCommand() diff --git a/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/android/AndroidOrientationsCommand.kt b/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/android/AndroidOrientationsCommand.kt index d6d35aba7f..82edbd35ad 100644 --- a/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/android/AndroidOrientationsCommand.kt +++ b/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/android/AndroidOrientationsCommand.kt @@ -1,7 +1,7 @@ package ftl.presentation.cli.firebase.test.android import ftl.presentation.cli.firebase.test.android.orientations.AndroidOrientationsListCommand -import ftl.util.PrintHelp +import ftl.util.PrintHelpCommand import picocli.CommandLine @CommandLine.Command( @@ -16,4 +16,4 @@ import picocli.CommandLine subcommands = [AndroidOrientationsListCommand::class], usageHelpAutoWidth = true ) -class AndroidOrientationsCommand : PrintHelp() +class AndroidOrientationsCommand : PrintHelpCommand() diff --git a/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/android/AndroidTestEnvironmentCommand.kt b/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/android/AndroidTestEnvironmentCommand.kt index cb60628efc..55ed56890f 100644 --- a/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/android/AndroidTestEnvironmentCommand.kt +++ b/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/android/AndroidTestEnvironmentCommand.kt @@ -7,7 +7,7 @@ import ftl.domain.invoke import ftl.presentation.cli.firebase.test.environment.prepareOutputString import ftl.presentation.outputLogger import ftl.presentation.throwUnknownType -import ftl.util.PrintHelp +import ftl.util.PrintHelpCommand import picocli.CommandLine @CommandLine.Command( @@ -28,7 +28,7 @@ import picocli.CommandLine usageHelpAutoWidth = true ) class AndroidTestEnvironmentCommand : - PrintHelp(), + PrintHelpCommand(), DescribeAndroidTestEnvironment { @CommandLine.Option( diff --git a/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/android/AndroidVersionsCommand.kt b/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/android/AndroidVersionsCommand.kt index 8f17a727c0..c35d363536 100644 --- a/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/android/AndroidVersionsCommand.kt +++ b/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/android/AndroidVersionsCommand.kt @@ -2,7 +2,7 @@ package ftl.presentation.cli.firebase.test.android import ftl.presentation.cli.firebase.test.android.versions.AndroidVersionsDescribeCommand import ftl.presentation.cli.firebase.test.android.versions.AndroidVersionsListCommand -import ftl.util.PrintHelp +import ftl.util.PrintHelpCommand import picocli.CommandLine @CommandLine.Command( @@ -17,4 +17,4 @@ import picocli.CommandLine subcommands = [AndroidVersionsListCommand::class, AndroidVersionsDescribeCommand::class], usageHelpAutoWidth = true ) -class AndroidVersionsCommand : PrintHelp() +class AndroidVersionsCommand : PrintHelpCommand() diff --git a/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/android/locales/AndroidLocalesDescribeCommand.kt b/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/android/locales/AndroidLocalesDescribeCommand.kt index 410b267072..4a291e9fb9 100644 --- a/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/android/locales/AndroidLocalesDescribeCommand.kt +++ b/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/android/locales/AndroidLocalesDescribeCommand.kt @@ -7,7 +7,7 @@ import ftl.domain.invoke import ftl.presentation.cli.firebase.test.locale.prepareDescription import ftl.presentation.outputLogger import ftl.presentation.throwUnknownType -import ftl.util.PrintHelp +import ftl.util.PrintHelpCommand import picocli.CommandLine @CommandLine.Command( @@ -21,7 +21,7 @@ import picocli.CommandLine usageHelpAutoWidth = true ) class AndroidLocalesDescribeCommand : - PrintHelp(), + PrintHelpCommand(), DescribeAndroidLocales { @CommandLine.Parameters( diff --git a/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/android/locales/AndroidLocalesListCommand.kt b/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/android/locales/AndroidLocalesListCommand.kt index 6aeb8b2d20..10ee130697 100644 --- a/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/android/locales/AndroidLocalesListCommand.kt +++ b/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/android/locales/AndroidLocalesListCommand.kt @@ -7,7 +7,7 @@ import ftl.domain.invoke import ftl.presentation.cli.firebase.test.locale.toCliTable import ftl.presentation.outputLogger import ftl.presentation.throwUnknownType -import ftl.util.PrintHelp +import ftl.util.PrintHelpCommand import ftl.util.asListOrNull import picocli.CommandLine @@ -23,7 +23,7 @@ import picocli.CommandLine usageHelpAutoWidth = true ) class AndroidLocalesListCommand : - PrintHelp(), + PrintHelpCommand(), ListAndroidLocales { @CommandLine.Option( diff --git a/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/android/models/AndroidModelDescribeCommand.kt b/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/android/models/AndroidModelDescribeCommand.kt index dbf979390d..26389a1bf3 100644 --- a/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/android/models/AndroidModelDescribeCommand.kt +++ b/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/android/models/AndroidModelDescribeCommand.kt @@ -7,7 +7,7 @@ import ftl.domain.invoke import ftl.presentation.cli.firebase.test.android.models.describe.prepareDescription import ftl.presentation.outputLogger import ftl.presentation.throwUnknownType -import ftl.util.PrintHelp +import ftl.util.PrintHelpCommand import picocli.CommandLine @CommandLine.Command( @@ -21,7 +21,7 @@ import picocli.CommandLine usageHelpAutoWidth = true ) class AndroidModelDescribeCommand : - PrintHelp(), + PrintHelpCommand(), DescribeAndroidModels { @CommandLine.Option( diff --git a/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/android/models/AndroidModelsListCommand.kt b/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/android/models/AndroidModelsListCommand.kt index 4b6df2eb34..648e0d6fe9 100644 --- a/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/android/models/AndroidModelsListCommand.kt +++ b/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/android/models/AndroidModelsListCommand.kt @@ -7,7 +7,7 @@ import ftl.domain.invoke import ftl.environment.android.toCliTable import ftl.presentation.outputLogger import ftl.presentation.throwUnknownType -import ftl.util.PrintHelp +import ftl.util.PrintHelpCommand import picocli.CommandLine @CommandLine.Command( @@ -22,7 +22,7 @@ import picocli.CommandLine usageHelpAutoWidth = true ) class AndroidModelsListCommand : - PrintHelp(), + PrintHelpCommand(), ListAndroidModels { @CommandLine.Option( diff --git a/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/android/orientations/AndroidOrientationsListCommand.kt b/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/android/orientations/AndroidOrientationsListCommand.kt index e1906b3ebc..b3998c004b 100644 --- a/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/android/orientations/AndroidOrientationsListCommand.kt +++ b/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/android/orientations/AndroidOrientationsListCommand.kt @@ -6,7 +6,7 @@ import ftl.domain.ListAndroidOrientations import ftl.domain.invoke import ftl.presentation.outputLogger import ftl.presentation.throwUnknownType -import ftl.util.PrintHelp +import ftl.util.PrintHelpCommand import ftl.util.asListOrNull import picocli.CommandLine @@ -22,7 +22,7 @@ import picocli.CommandLine usageHelpAutoWidth = true ) class AndroidOrientationsListCommand : - PrintHelp(), + PrintHelpCommand(), ListAndroidOrientations { @CommandLine.Option( diff --git a/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/android/versions/AndroidVersionsDescribeCommand.kt b/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/android/versions/AndroidVersionsDescribeCommand.kt index a4125f8ce0..8d6c2d6d39 100644 --- a/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/android/versions/AndroidVersionsDescribeCommand.kt +++ b/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/android/versions/AndroidVersionsDescribeCommand.kt @@ -7,7 +7,7 @@ import ftl.domain.invoke import ftl.environment.android.prepareDescription import ftl.presentation.outputLogger import ftl.presentation.throwUnknownType -import ftl.util.PrintHelp +import ftl.util.PrintHelpCommand import picocli.CommandLine @CommandLine.Command( @@ -22,7 +22,7 @@ import picocli.CommandLine usageHelpAutoWidth = true ) class AndroidVersionsDescribeCommand : - PrintHelp(), + PrintHelpCommand(), DescribeAndroidVersions { @CommandLine.Option( diff --git a/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/android/versions/AndroidVersionsListCommand.kt b/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/android/versions/AndroidVersionsListCommand.kt index d3fd03a19c..637412bccd 100644 --- a/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/android/versions/AndroidVersionsListCommand.kt +++ b/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/android/versions/AndroidVersionsListCommand.kt @@ -6,7 +6,7 @@ import ftl.domain.ListAndroidVersions import ftl.domain.invoke import ftl.presentation.outputLogger import ftl.presentation.throwUnknownType -import ftl.util.PrintHelp +import ftl.util.PrintHelpCommand import ftl.util.asListOrNull import picocli.CommandLine @@ -22,7 +22,7 @@ import picocli.CommandLine usageHelpAutoWidth = true ) class AndroidVersionsListCommand : - PrintHelp(), + PrintHelpCommand(), ListAndroidVersions { @CommandLine.Option( diff --git a/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/ios/IosDoctorCommand.kt b/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/ios/IosDoctorCommand.kt index 0843a3e7cd..776dccbc54 100644 --- a/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/ios/IosDoctorCommand.kt +++ b/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/ios/IosDoctorCommand.kt @@ -7,7 +7,7 @@ import ftl.domain.invoke import ftl.presentation.cli.firebase.test.summary import ftl.presentation.outputLogger import ftl.presentation.throwUnknownType -import ftl.util.PrintHelp +import ftl.util.PrintHelpCommand import picocli.CommandLine.Command import picocli.CommandLine.Option @@ -27,7 +27,7 @@ import picocli.CommandLine.Option usageHelpAutoWidth = true ) class IosDoctorCommand : - PrintHelp(), + PrintHelpCommand(), RunDoctor { @Option( diff --git a/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/ios/IosLocalesCommand.kt b/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/ios/IosLocalesCommand.kt index 43452d9927..90d81002bb 100644 --- a/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/ios/IosLocalesCommand.kt +++ b/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/ios/IosLocalesCommand.kt @@ -2,7 +2,7 @@ package ftl.presentation.cli.firebase.test.ios import ftl.presentation.cli.firebase.test.ios.configuration.IosLocalesDescribeCommand import ftl.presentation.cli.firebase.test.ios.configuration.IosLocalesListCommand -import ftl.util.PrintHelp +import ftl.util.PrintHelpCommand import picocli.CommandLine @CommandLine.Command( @@ -17,4 +17,4 @@ import picocli.CommandLine subcommands = [IosLocalesListCommand::class, IosLocalesDescribeCommand::class], usageHelpAutoWidth = true ) -class IosLocalesCommand : PrintHelp() +class IosLocalesCommand : PrintHelpCommand() diff --git a/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/ios/IosModelsCommand.kt b/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/ios/IosModelsCommand.kt index 46032721c3..c40d712b89 100644 --- a/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/ios/IosModelsCommand.kt +++ b/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/ios/IosModelsCommand.kt @@ -2,7 +2,7 @@ package ftl.presentation.cli.firebase.test.ios import ftl.presentation.cli.firebase.test.ios.models.IosModelDescribeCommand import ftl.presentation.cli.firebase.test.ios.models.IosModelsListCommand -import ftl.util.PrintHelp +import ftl.util.PrintHelpCommand import picocli.CommandLine @CommandLine.Command( @@ -17,4 +17,4 @@ import picocli.CommandLine subcommands = [IosModelsListCommand::class, IosModelDescribeCommand::class], usageHelpAutoWidth = true ) -class IosModelsCommand : PrintHelp() +class IosModelsCommand : PrintHelpCommand() diff --git a/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/ios/IosOrientationsCommand.kt b/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/ios/IosOrientationsCommand.kt index cac31503cd..dc5ac89d00 100644 --- a/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/ios/IosOrientationsCommand.kt +++ b/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/ios/IosOrientationsCommand.kt @@ -1,7 +1,7 @@ package ftl.presentation.cli.firebase.test.ios import ftl.presentation.cli.firebase.test.ios.orientations.IosOrientationsListCommand -import ftl.util.PrintHelp +import ftl.util.PrintHelpCommand import picocli.CommandLine @CommandLine.Command( @@ -16,4 +16,4 @@ import picocli.CommandLine subcommands = [IosOrientationsListCommand::class], usageHelpAutoWidth = true ) -class IosOrientationsCommand : PrintHelp() +class IosOrientationsCommand : PrintHelpCommand() diff --git a/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/ios/IosTestEnvironmentCommand.kt b/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/ios/IosTestEnvironmentCommand.kt index fa29932fc7..aef1ad9a8a 100644 --- a/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/ios/IosTestEnvironmentCommand.kt +++ b/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/ios/IosTestEnvironmentCommand.kt @@ -7,7 +7,7 @@ import ftl.domain.invoke import ftl.presentation.cli.firebase.test.environment.prepareOutputString import ftl.presentation.outputLogger import ftl.presentation.throwUnknownType -import ftl.util.PrintHelp +import ftl.util.PrintHelpCommand import picocli.CommandLine @CommandLine.Command( @@ -28,7 +28,7 @@ import picocli.CommandLine usageHelpAutoWidth = true ) class IosTestEnvironmentCommand : - PrintHelp(), + PrintHelpCommand(), DescribeIosTestEnvironment { @CommandLine.Option( diff --git a/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/ios/IosVersionsCommand.kt b/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/ios/IosVersionsCommand.kt index 769ec63e82..01423d0a0c 100644 --- a/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/ios/IosVersionsCommand.kt +++ b/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/ios/IosVersionsCommand.kt @@ -2,7 +2,7 @@ package ftl.presentation.cli.firebase.test.ios import ftl.presentation.cli.firebase.test.ios.versions.IosVersionsDescribeCommand import ftl.presentation.cli.firebase.test.ios.versions.IosVersionsListCommand -import ftl.util.PrintHelp +import ftl.util.PrintHelpCommand import picocli.CommandLine @CommandLine.Command( @@ -17,4 +17,4 @@ import picocli.CommandLine description = ["Information about available software versions. For example prints list of available software versions"], usageHelpAutoWidth = true ) -class IosVersionsCommand : PrintHelp() +class IosVersionsCommand : PrintHelpCommand() diff --git a/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/ios/configuration/IosLocalesDescribeCommand.kt b/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/ios/configuration/IosLocalesDescribeCommand.kt index 8dd287b9c0..5e8e14f0db 100644 --- a/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/ios/configuration/IosLocalesDescribeCommand.kt +++ b/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/ios/configuration/IosLocalesDescribeCommand.kt @@ -7,7 +7,7 @@ import ftl.domain.invoke import ftl.presentation.cli.firebase.test.locale.prepareDescription import ftl.presentation.outputLogger import ftl.presentation.throwUnknownType -import ftl.util.PrintHelp +import ftl.util.PrintHelpCommand import picocli.CommandLine @CommandLine.Command( @@ -21,7 +21,7 @@ import picocli.CommandLine usageHelpAutoWidth = true ) class IosLocalesDescribeCommand : - PrintHelp(), + PrintHelpCommand(), DescribeIosLocales { @CommandLine.Parameters( diff --git a/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/ios/configuration/IosLocalesListCommand.kt b/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/ios/configuration/IosLocalesListCommand.kt index fdc3b261ef..f0433b11d2 100644 --- a/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/ios/configuration/IosLocalesListCommand.kt +++ b/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/ios/configuration/IosLocalesListCommand.kt @@ -7,7 +7,7 @@ import ftl.domain.invoke import ftl.presentation.cli.firebase.test.locale.toCliTable import ftl.presentation.outputLogger import ftl.presentation.throwUnknownType -import ftl.util.PrintHelp +import ftl.util.PrintHelpCommand import ftl.util.asListOrNull import picocli.CommandLine @@ -23,7 +23,7 @@ import picocli.CommandLine usageHelpAutoWidth = true ) class IosLocalesListCommand : - PrintHelp(), + PrintHelpCommand(), ListIosLocales { @CommandLine.Option( diff --git a/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/ios/models/IosModelDescribeCommand.kt b/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/ios/models/IosModelDescribeCommand.kt index d851806c65..b0c72af087 100644 --- a/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/ios/models/IosModelDescribeCommand.kt +++ b/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/ios/models/IosModelDescribeCommand.kt @@ -7,7 +7,7 @@ import ftl.domain.invoke import ftl.presentation.cli.firebase.test.ios.models.describe.prepareDescription import ftl.presentation.outputLogger import ftl.presentation.throwUnknownType -import ftl.util.PrintHelp +import ftl.util.PrintHelpCommand import picocli.CommandLine @CommandLine.Command( @@ -21,7 +21,7 @@ import picocli.CommandLine usageHelpAutoWidth = true ) class IosModelDescribeCommand : - PrintHelp(), + PrintHelpCommand(), DescribeIosModels { @CommandLine.Option( diff --git a/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/ios/models/IosModelsListCommand.kt b/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/ios/models/IosModelsListCommand.kt index 4fec279f1d..41cf27672a 100644 --- a/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/ios/models/IosModelsListCommand.kt +++ b/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/ios/models/IosModelsListCommand.kt @@ -7,7 +7,7 @@ import ftl.domain.invoke import ftl.environment.ios.toCliTable import ftl.presentation.outputLogger import ftl.presentation.throwUnknownType -import ftl.util.PrintHelp +import ftl.util.PrintHelpCommand import picocli.CommandLine @CommandLine.Command( @@ -22,7 +22,7 @@ import picocli.CommandLine usageHelpAutoWidth = true ) class IosModelsListCommand : - PrintHelp(), + PrintHelpCommand(), ListIosModels { @CommandLine.Option( diff --git a/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/ios/orientations/IosOrientationsListCommand.kt b/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/ios/orientations/IosOrientationsListCommand.kt index 05e638cdc8..813929db97 100644 --- a/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/ios/orientations/IosOrientationsListCommand.kt +++ b/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/ios/orientations/IosOrientationsListCommand.kt @@ -5,10 +5,9 @@ import ftl.config.FtlConstants import ftl.domain.ListIosOrientations import ftl.domain.invoke import ftl.presentation.cli.firebase.test.android.orientations.toCliTable -import ftl.presentation.cli.firebase.test.locale.toCliTable import ftl.presentation.outputLogger import ftl.presentation.throwUnknownType -import ftl.util.PrintHelp +import ftl.util.PrintHelpCommand import ftl.util.asListOrNull import picocli.CommandLine @@ -24,7 +23,7 @@ import picocli.CommandLine usageHelpAutoWidth = true ) class IosOrientationsListCommand : - PrintHelp(), + PrintHelpCommand(), ListIosOrientations { @CommandLine.Option( diff --git a/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/ios/versions/IosVersionsDescribeCommand.kt b/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/ios/versions/IosVersionsDescribeCommand.kt index cc02092ef0..6d8a2ac6c9 100644 --- a/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/ios/versions/IosVersionsDescribeCommand.kt +++ b/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/ios/versions/IosVersionsDescribeCommand.kt @@ -7,7 +7,7 @@ import ftl.domain.invoke import ftl.presentation.cli.firebase.test.ios.models.describe.prepareDescription import ftl.presentation.outputLogger import ftl.presentation.throwUnknownType -import ftl.util.PrintHelp +import ftl.util.PrintHelpCommand import picocli.CommandLine @CommandLine.Command( @@ -22,7 +22,7 @@ import picocli.CommandLine usageHelpAutoWidth = true ) class IosVersionsDescribeCommand : - PrintHelp(), + PrintHelpCommand(), DescribeIosVersions { @CommandLine.Option( diff --git a/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/ios/versions/IosVersionsListCommand.kt b/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/ios/versions/IosVersionsListCommand.kt index 7f079ae5fa..9d144961aa 100644 --- a/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/ios/versions/IosVersionsListCommand.kt +++ b/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/ios/versions/IosVersionsListCommand.kt @@ -7,7 +7,7 @@ import ftl.domain.invoke import ftl.environment.ios.toCliTable import ftl.presentation.outputLogger import ftl.presentation.throwUnknownType -import ftl.util.PrintHelp +import ftl.util.PrintHelpCommand import picocli.CommandLine @CommandLine.Command( @@ -22,7 +22,7 @@ import picocli.CommandLine usageHelpAutoWidth = true ) class IosVersionsListCommand : - PrintHelp(), + PrintHelpCommand(), ListIosVersions { @CommandLine.Option( diff --git a/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/ipblocks/IPBlocksListCommand.kt b/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/ipblocks/IPBlocksListCommand.kt index 9833966a61..294a19983a 100644 --- a/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/ipblocks/IPBlocksListCommand.kt +++ b/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/ipblocks/IPBlocksListCommand.kt @@ -5,7 +5,7 @@ import ftl.domain.ListIPBlocks import ftl.domain.invoke import ftl.presentation.outputLogger import ftl.presentation.throwUnknownType -import ftl.util.PrintHelp +import ftl.util.PrintHelpCommand import picocli.CommandLine @CommandLine.Command( @@ -20,7 +20,7 @@ import picocli.CommandLine usageHelpAutoWidth = true ) class IPBlocksListCommand : - PrintHelp(), + PrintHelpCommand(), ListIPBlocks { override fun run() = invoke() diff --git a/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/networkprofiles/NetworkProfilesDescribeCommand.kt b/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/networkprofiles/NetworkProfilesDescribeCommand.kt index 82062c4dcb..e28e8f8cfd 100644 --- a/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/networkprofiles/NetworkProfilesDescribeCommand.kt +++ b/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/networkprofiles/NetworkProfilesDescribeCommand.kt @@ -6,7 +6,7 @@ import ftl.domain.invoke import ftl.environment.prepareDescription import ftl.presentation.outputLogger import ftl.presentation.throwUnknownType -import ftl.util.PrintHelp +import ftl.util.PrintHelpCommand import picocli.CommandLine @CommandLine.Command( @@ -21,7 +21,7 @@ import picocli.CommandLine usageHelpAutoWidth = true ) class NetworkProfilesDescribeCommand : - PrintHelp(), + PrintHelpCommand(), DescribeNetworkProfiles { @CommandLine.Parameters( diff --git a/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/networkprofiles/NetworkProfilesListCommand.kt b/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/networkprofiles/NetworkProfilesListCommand.kt index beb7493316..c7eade519a 100644 --- a/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/networkprofiles/NetworkProfilesListCommand.kt +++ b/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/networkprofiles/NetworkProfilesListCommand.kt @@ -5,7 +5,7 @@ import ftl.domain.ListNetworkProfiles import ftl.domain.invoke import ftl.presentation.outputLogger import ftl.presentation.throwUnknownType -import ftl.util.PrintHelp +import ftl.util.PrintHelpCommand import ftl.util.asList import ftl.util.asListOrNull import picocli.CommandLine @@ -22,7 +22,7 @@ import picocli.CommandLine usageHelpAutoWidth = true ) class NetworkProfilesListCommand : - PrintHelp(), + PrintHelpCommand(), ListNetworkProfiles { override fun run() = invoke() diff --git a/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/providedsoftware/ProvidedSoftwareListCommand.kt b/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/providedsoftware/ProvidedSoftwareListCommand.kt index 36f3568fc6..ed89c7a29b 100644 --- a/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/providedsoftware/ProvidedSoftwareListCommand.kt +++ b/test_runner/src/main/kotlin/ftl/presentation/cli/firebase/test/providedsoftware/ProvidedSoftwareListCommand.kt @@ -5,7 +5,7 @@ import ftl.domain.ListProvidedSoftware import ftl.domain.invoke import ftl.presentation.outputLogger import ftl.presentation.throwUnknownType -import ftl.util.PrintHelp +import ftl.util.PrintHelpCommand import picocli.CommandLine @CommandLine.Command( @@ -20,7 +20,7 @@ import picocli.CommandLine usageHelpAutoWidth = true ) class ProvidedSoftwareListCommand : - PrintHelp(), + PrintHelpCommand(), ListProvidedSoftware { override fun run() = invoke() diff --git a/test_runner/src/main/kotlin/ftl/util/PrintHelp.kt b/test_runner/src/main/kotlin/ftl/util/PrintHelpCommand.kt similarity index 87% rename from test_runner/src/main/kotlin/ftl/util/PrintHelp.kt rename to test_runner/src/main/kotlin/ftl/util/PrintHelpCommand.kt index 5cffa8083c..4461bb4108 100644 --- a/test_runner/src/main/kotlin/ftl/util/PrintHelp.kt +++ b/test_runner/src/main/kotlin/ftl/util/PrintHelpCommand.kt @@ -2,7 +2,7 @@ package ftl.util import picocli.CommandLine -abstract class PrintHelp : Runnable { +abstract class PrintHelpCommand : Runnable { override fun run() { CommandLine.usage(this, System.out) } diff --git a/test_runner/src/test/kotlin/ftl/cli/CliTest.kt b/test_runner/src/test/kotlin/ftl/cli/CliTest.kt index 4ee2a69e4c..e416ad4afb 100644 --- a/test_runner/src/test/kotlin/ftl/cli/CliTest.kt +++ b/test_runner/src/test/kotlin/ftl/cli/CliTest.kt @@ -29,5 +29,5 @@ class CliTest { private fun Collection.getCommandWithoutHelp() = map { command -> command to command.commandSpec.args().mapNotNull { arg -> arg as? CommandLine.Model.OptionSpec } .any { arg -> arg.names().contains("-h") || arg.names().contains("--help") } - }.filter { !it.second }.map { it.first } + }.filter { (_, containsHelp) -> !containsHelp }.map { (command, _) -> command } }