@@ -29,7 +29,7 @@ abstract class ScalaCommand[T](implicit parser: Parser[T], help: Help[T])
29
29
}
30
30
31
31
// TODO Manage to have case-app give use the exact command name that was used instead
32
- protected def commandLength = names.headOption.fold(1 )(_.length)
32
+ protected def commandLength : Int = names.headOption.fold(1 )(_.length)
33
33
34
34
override def error (message : Error ): Nothing = {
35
35
System .err.println(message.message)
@@ -48,19 +48,17 @@ abstract class ScalaCommand[T](implicit parser: Parser[T], help: Help[T])
48
48
// FIXME Report this in case-app default NameFormatter
49
49
override lazy val nameFormatter : Formatter [Name ] = {
50
50
val parent = super .nameFormatter
51
- new Formatter [Name ] {
52
- def format (t : Name ): String =
53
- if (t.name.startsWith(" -" )) t.name
54
- else parent.format(t)
55
- }
51
+ (t : Name ) =>
52
+ if (t.name.startsWith(" -" )) t.name
53
+ else parent.format(t)
56
54
}
57
55
58
56
override def completer : Completer [T ] = {
59
57
val parent = super .completer
60
58
new Completer [T ] {
61
- def optionName (prefix : String , state : Option [T ]) =
59
+ def optionName (prefix : String , state : Option [T ]): List [ CompletionItem ] =
62
60
parent.optionName(prefix, state)
63
- def optionValue (arg : Arg , prefix : String , state : Option [T ]) = {
61
+ def optionValue (arg : Arg , prefix : String , state : Option [T ]): List [ CompletionItem ] = {
64
62
val candidates = arg.name.name match {
65
63
case " dependency" =>
66
64
state.flatMap(sharedOptions).toList.flatMap { sharedOptions =>
@@ -92,7 +90,7 @@ abstract class ScalaCommand[T](implicit parser: Parser[T], help: Help[T])
92
90
}
93
91
candidates ++ parent.optionValue(arg, prefix, state)
94
92
}
95
- def argument (prefix : String , state : Option [T ]) =
93
+ def argument (prefix : String , state : Option [T ]): List [ CompletionItem ] =
96
94
parent.argument(prefix, state)
97
95
}
98
96
}
@@ -137,7 +135,7 @@ abstract class ScalaCommand[T](implicit parser: Parser[T], help: Help[T])
137
135
sys.exit(exitCode)
138
136
}
139
137
140
- override def helpFormat =
138
+ override def helpFormat : HelpFormat =
141
139
HelpFormat .default()
142
140
.withSortedGroups(Some (Seq (
143
141
" Help" ,
0 commit comments