Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Added missing help command #2020

Merged
merged 7 commits into from
Jun 10, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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 = ";",
Expand Down
Original file line number Diff line number Diff line change
@@ -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(
Expand All @@ -13,4 +13,4 @@ import picocli.CommandLine.Command
],
usageHelpAutoWidth = true
)
class AuthCommand : PrintHelp
class AuthCommand : PrintHelpCommand()
Original file line number Diff line number Diff line change
@@ -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(
Expand All @@ -12,4 +12,4 @@ import picocli.CommandLine.Command
],
usageHelpAutoWidth = true
)
class CorelliumCommand : PrintHelp
class CorelliumCommand : PrintHelpCommand()
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -16,4 +16,4 @@ import picocli.CommandLine.Command
],
usageHelpAutoWidth = true
)
class FirebaseCommand : PrintHelp
class FirebaseCommand : PrintHelpCommand()
Original file line number Diff line number Diff line change
Expand Up @@ -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.PrintHelpCommand
import ftl.util.printVersionInfo
import picocli.CommandLine

Expand All @@ -27,7 +28,7 @@ import picocli.CommandLine
IPBlocksCommand::class
]
)
class MainCommand : Runnable {
class MainCommand : PrintHelpCommand() {

@CommandLine.Option(
names = ["-v", "--version"],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package ftl.presentation.cli.auth

import ftl.domain.LoginGoogleAccount
import ftl.domain.invoke
import ftl.util.PrintHelpCommand
import picocli.CommandLine

@CommandLine.Command(
Expand All @@ -17,15 +18,8 @@ import picocli.CommandLine
usageHelpAutoWidth = true
)
class LoginCommand :
Runnable,
PrintHelpCommand(),
LoginGoogleAccount {

@CommandLine.Option(
names = ["-h", "--help"],
usageHelp = true,
description = ["Prints this help message"]
)
var usageHelpRequested: Boolean = false

override fun run() = invoke()
}
Original file line number Diff line number Diff line change
@@ -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(
Expand All @@ -12,4 +12,4 @@ import picocli.CommandLine.Command
],
usageHelpAutoWidth = true
)
class TestCommand : PrintHelp
class TestCommand : PrintHelpCommand()
Original file line number Diff line number Diff line change
@@ -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(
Expand All @@ -12,4 +12,4 @@ import picocli.CommandLine.Command
],
usageHelpAutoWidth = true
)
class AndroidCommand : PrintHelp
class AndroidCommand : PrintHelpCommand()
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import ftl.domain.invoke
import ftl.presentation.outputLogger
import ftl.presentation.throwUnknownType
import ftl.run.MatrixCancelStatus
import ftl.util.PrintHelpCommand
import picocli.CommandLine

@CommandLine.Command(
Expand All @@ -24,16 +25,9 @@ Reads in the matrix_ids.json file. Cancels any incomplete matrices.
usageHelpAutoWidth = true
)
class CancelCommand :
Runnable,
PrintHelpCommand(),
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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ package ftl.presentation.cli.firebase

import ftl.domain.RefreshLastRun
import ftl.domain.invoke
import ftl.util.PrintHelpCommand
import kotlinx.coroutines.runBlocking
import picocli.CommandLine.Command
import picocli.CommandLine.Option

@Command(
name = "refresh",
Expand All @@ -23,15 +23,8 @@ Reads in the matrix_ids.json file. Refreshes any incomplete matrices.
usageHelpAutoWidth = true
)
class RefreshCommand :
Runnable,
PrintHelpCommand(),
RefreshLastRun {

@Option(
names = ["-h", "--help"],
usageHelp = true,
description = ["Prints this help message"]
)
var usageHelpRequested: Boolean = false

override fun run() = runBlocking { invoke() }
}
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -20,4 +20,4 @@ import picocli.CommandLine.Command
],
usageHelpAutoWidth = true
)
class TestCommand : PrintHelp
class TestCommand : PrintHelpCommand()
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -24,4 +24,4 @@ import picocli.CommandLine.Command
],
usageHelpAutoWidth = true
)
class AndroidCommand : PrintHelp
class AndroidCommand : PrintHelpCommand()
Original file line number Diff line number Diff line change
Expand Up @@ -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.PrintHelpCommand
import picocli.CommandLine

abstract class CommonRunCommand : Runnable {
abstract class CommonRunCommand : PrintHelpCommand() {

@CommandLine.Mixin
private val commonGcloudConfig = CommonGcloudConfig()
Expand All @@ -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"],
Expand Down
Original file line number Diff line number Diff line change
@@ -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(
Expand All @@ -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()
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -24,4 +24,4 @@ import picocli.CommandLine.Command
],
usageHelpAutoWidth = true
)
class IosCommand : PrintHelp
class IosCommand : PrintHelpCommand()
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -15,4 +15,4 @@ import picocli.CommandLine
header = ["Explore network profiles available for testing."],
usageHelpAutoWidth = true
)
class NetworkProfilesCommand : PrintHelp
class NetworkProfilesCommand : PrintHelpCommand()
Original file line number Diff line number Diff line change
@@ -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(
Expand All @@ -12,4 +12,4 @@ import picocli.CommandLine
],
usageHelpAutoWidth = true
)
class ProvidedSoftwareCommand : PrintHelp
class ProvidedSoftwareCommand : PrintHelpCommand()
Original file line number Diff line number Diff line change
Expand Up @@ -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.PrintHelpCommand
import picocli.CommandLine.Command
import picocli.CommandLine.Option

Expand All @@ -26,16 +27,9 @@ import picocli.CommandLine.Option
usageHelpAutoWidth = true
)
class AndroidDoctorCommand :
Runnable,
PrintHelpCommand(),
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"]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -17,4 +17,4 @@ import picocli.CommandLine
subcommands = [AndroidLocalesListCommand::class, AndroidLocalesDescribeCommand::class],
usageHelpAutoWidth = true
)
class AndroidLocalesCommand : PrintHelp
class AndroidLocalesCommand : PrintHelpCommand()
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -17,4 +17,4 @@ import picocli.CommandLine
subcommands = [AndroidModelsListCommand::class, AndroidModelDescribeCommand::class],
usageHelpAutoWidth = true
)
class AndroidModelsCommand : PrintHelp
class AndroidModelsCommand : PrintHelpCommand()
Original file line number Diff line number Diff line change
@@ -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(
Expand All @@ -16,4 +16,4 @@ import picocli.CommandLine
subcommands = [AndroidOrientationsListCommand::class],
usageHelpAutoWidth = true
)
class AndroidOrientationsCommand : PrintHelp
class AndroidOrientationsCommand : PrintHelpCommand()
Loading