File tree 1 file changed +11
-5
lines changed
src/dotty/tools/dotc/config
1 file changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -109,7 +109,7 @@ object Settings {
109
109
ArgsSummary (sstate, args, errors :+ msg)
110
110
def missingArg =
111
111
fail(s " missing argument for option $name" , args)
112
- def doSet (argRest : String ) = ((implicitly[ClassTag [T ]], args): @ unchecked) match {
112
+ def doSet (argRest : String = " " ) = ((implicitly[ClassTag [T ]], args): @ unchecked) match {
113
113
case (BooleanTag , _) =>
114
114
update(true , args)
115
115
case (ListTag , _) =>
@@ -146,10 +146,16 @@ object Settings {
146
146
missingArg
147
147
}
148
148
149
- if (prefix != " " && arg.startsWith(prefix))
150
- doSet(arg drop prefix.length)
151
- else if (prefix == " " && name == arg.takeWhile(_ != ':' ))
152
- doSet(arg.dropWhile(_ != ':' ).drop(1 ))
149
+ if (prefix != " " )
150
+ if (arg.startsWith(prefix)) doSet(arg.drop(prefix.length))
151
+ else state
152
+ else if (arg.contains(':' ) && name == arg.takeWhile(_ != ':' )) {
153
+ val value = arg.dropWhile(_ != ':' ).drop(1 )
154
+ if (value.isEmpty) missingArg
155
+ else doSet(value)
156
+ }
157
+ else if (name == arg)
158
+ doSet()
153
159
else
154
160
state
155
161
}
You can’t perform that action at this time.
0 commit comments