Skip to content

Commit

Permalink
Update note.
Browse files Browse the repository at this point in the history
  • Loading branch information
devoxin committed Dec 22, 2019
1 parent 8b555d7 commit cf77c1d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/main/kotlin/me/devoxin/flight/arguments/ArgParser.kt
Original file line number Diff line number Diff line change
Expand Up @@ -135,10 +135,10 @@ class ArgParser(
val res = parser.parse(arg)

if (res != null || arg.valueRequired) {
//parse() will take care of arguments whose values are null but are required, and will
// throw an exception accordingly. Arguments that make it to this point are deemed optional
// so we can just skip putting them into the map. This allows us to leverage default method parameters
// within Kotlin.
//This will only place the argument into the map if the value is null,
// or if the parameter requires a value (i.e. marked nullable).
//Commands marked optional already have a parameter so they don't need user-provided values
// unless the argument was successfully resolved for that parameter.
resolvedArgs[arg.kparam] = res
}
}
Expand Down

0 comments on commit cf77c1d

Please sign in to comment.