File tree Expand file tree Collapse file tree 6 files changed +31
-10
lines changed
commonMain/kotlin/com/github/ajalt/clikt/core
commonTest/kotlin/com/github/ajalt/clikt/core
src/commonMain/kotlin/com/github/ajalt/clikt/core
samples/aliases/src/main/kotlin/com/github/ajalt/clikt/samples/aliases Expand file tree Collapse file tree 6 files changed +31
-10
lines changed Original file line number Diff line number Diff line change @@ -43,6 +43,13 @@ public final class com/github/ajalt/clikt/core/MordantContextKt {
4343 public static final fun setTerminal (Lcom/github/ajalt/clikt/core/Context$Builder;Lcom/github/ajalt/mordant/terminal/Terminal;)V
4444}
4545
46+ public class com/github/ajalt/clikt/core/NoOpCliktCommand : com/github/ajalt/clikt/core/CliktCommand {
47+ public fun <init> ()V
48+ public fun <init> (Ljava/lang/String;)V
49+ public synthetic fun <init> (Ljava/lang/String;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
50+ public final fun run ()V
51+ }
52+
4653public class com/github/ajalt/clikt/output/MordantHelpFormatter : com/github/ajalt/clikt/output/AbstractHelpFormatter {
4754 public fun <init> (Lcom/github/ajalt/clikt/core/Context;Ljava/lang/String;ZZ)V
4855 public synthetic fun <init> (Lcom/github/ajalt/clikt/core/Context;Ljava/lang/String;ZZILkotlin/jvm/internal/DefaultConstructorMarker;)V
Original file line number Diff line number Diff line change 1+ package com.github.ajalt.clikt.core
2+
3+ /* *
4+ * A [CoreCliktCommand] that has a default implementation of [CliktCommand.run] that is a no-op.
5+ */
6+ open class NoOpCliktCommand (
7+ /* *
8+ * The name of the program to use in the help output. If not given, it is inferred from the
9+ * class name.
10+ */
11+ name : String? = null ,
12+ ) : CliktCommand(name) {
13+ final override fun run () {}
14+ }
Original file line number Diff line number Diff line change @@ -34,7 +34,7 @@ class CliktCommandTest {
3434 class ListAllValuesCommand : TestCommand ()
3535 class LGTMMeansLookingGoodToMe : TestCommand ()
3636 class `nothing- to- change` : TestCommand ()
37- class ListCommands : NoOpCliktCommand ()
37+ class ListCommands : CoreNoOpCliktCommand ()
3838 ListAllValuesCommand ().commandName shouldBe " list-all-values"
3939 LGTMMeansLookingGoodToMe ().commandName shouldBe " lgtmmeans-looking-good-to-me"
4040 `nothing- to- change`().commandName shouldBe " nothing-to-change"
Original file line number Diff line number Diff line change @@ -307,6 +307,13 @@ public final class com/github/ajalt/clikt/core/CoreCliktCommandKt {
307307 public static final fun parse (Lcom/github/ajalt/clikt/core/CoreCliktCommand;[Ljava/lang/String;)V
308308}
309309
310+ public class com/github/ajalt/clikt/core/CoreNoOpCliktCommand : com/github/ajalt/clikt/core/CoreCliktCommand {
311+ public fun <init> ()V
312+ public fun <init> (Ljava/lang/String;)V
313+ public synthetic fun <init> (Ljava/lang/String;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
314+ public final fun run ()V
315+ }
316+
310317public final class com/github/ajalt/clikt/core/FileNotFound : com/github/ajalt/clikt/core/UsageError {
311318 public fun <init> (Ljava/lang/String;)V
312319 public fun formatMessage (Lcom/github/ajalt/clikt/output/Localization;Lcom/github/ajalt/clikt/output/ParameterFormatter;)Ljava/lang/String;
@@ -374,13 +381,6 @@ public final class com/github/ajalt/clikt/core/MutuallyExclusiveGroupException :
374381 public final fun getNames ()Ljava/util/List;
375382}
376383
377- public class com/github/ajalt/clikt/core/NoOpCliktCommand : com/github/ajalt/clikt/core/CoreCliktCommand {
378- public fun <init> ()V
379- public fun <init> (Ljava/lang/String;)V
380- public synthetic fun <init> (Ljava/lang/String;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
381- public final fun run ()V
382- }
383-
384384public final class com/github/ajalt/clikt/core/NoSuchArgument : com/github/ajalt/clikt/core/UsageError {
385385 public fun <init> (Ljava/util/List;)V
386386 public fun formatMessage (Lcom/github/ajalt/clikt/output/Localization;Lcom/github/ajalt/clikt/output/ParameterFormatter;)Ljava/lang/String;
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ package com.github.ajalt.clikt.core
33/* *
44 * A [CoreCliktCommand] that has a default implementation of [CoreCliktCommand.run] that is a no-op.
55 */
6- open class NoOpCliktCommand (
6+ open class CoreNoOpCliktCommand (
77 /* *
88 * The name of the program to use in the help output. If not given, it is inferred from the
99 * class name.
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ import java.io.File
1010 * @param configFile A config file containing aliases, one per line, in the form `token = alias`. Aliases can
1111 * have multiple tokens (e.g. `cm = commit -m`).
1212 */
13- class AliasedCli (private val configFile : File ) : NoOpCliktCommand () {
13+ class AliasedCli (private val configFile : File ) : CoreNoOpCliktCommand () {
1414 override fun help (context : Context ) = " An example that supports aliased subcommands"
1515 override fun aliases (): Map <String , List <String >> {
1616 return configFile.readLines().map { it.split(" =" , limit = 2 ) }
You can’t perform that action at this time.
0 commit comments