File tree 2 files changed +4
-4
lines changed 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ trait MainAnnotation extends StaticAnnotation:
24
24
def command (args : Array [String ], commandName : String , docComment : String ): Command
25
25
26
26
/** A class representing a command to run */
27
- abstract class Command ( val commandName : String , val docComment : String ) :
27
+ trait Command :
28
28
29
29
/** The getter for the next argument of type `T` */
30
30
def argGetter [T ](argName : String , argType : String , argDoc : String )(using fromString : ArgumentParser [T ]): () => T
Original file line number Diff line number Diff line change @@ -91,7 +91,7 @@ class main extends scala.annotation.MainAnnotation:
91
91
case _ =>
92
92
93
93
override def command (args : Array [String ], commandName : String , docComment : String ): Command =
94
- new Command (commandName, docComment) :
94
+ new Command :
95
95
/** A buffer of demanded arguments */
96
96
private var argInfos = new mutable.ListBuffer [self.Argument ]
97
97
@@ -121,10 +121,10 @@ class main extends scala.annotation.MainAnnotation:
121
121
case None => error(s " invalid argument for $argName: $arg" )
122
122
123
123
private def usage (): Unit =
124
- self.usage(this . commandName, argInfos.toSeq)
124
+ self.usage(commandName, argInfos.toSeq)
125
125
126
126
private def explain (): Unit =
127
- self.explain(this . commandName, this . docComment, argInfos.toSeq)
127
+ self.explain(commandName, docComment, argInfos.toSeq)
128
128
129
129
private def indicesOfArg (argName : String ): Seq [Int ] =
130
130
def allIndicesOf (s : String ): Seq [Int ] =
You can’t perform that action at this time.
0 commit comments