Skip to content

Commit 81ebb1e

Browse files
Rename defaultValueOpt for clearer name
1 parent fa9a7f3 commit 81ebb1e

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

library/src/scala/annotation/MainAnnotation.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ object MainAnnotation:
3434
/** The docstring of the parameter. Defaults to None. */
3535
val documentation: Option[String],
3636
/** The default value that the parameter has. Defaults to None. */
37-
val defaultValueOpt: Option[() => T],
37+
val defaultValueGetterOpt: Option[() => T],
3838
/** The ParameterAnnotations associated with the parameter. Defaults to Seq.empty. */
3939
val annotations: Seq[ParameterAnnotation],
4040
) {
@@ -46,10 +46,10 @@ object MainAnnotation:
4646
new ParameterInfos(name, typeName, documentation, Some(() => defaultValue), annotations)
4747

4848
def withDocumentation(doc: String): ParameterInfos[T] =
49-
new ParameterInfos(name, typeName, Some(doc), defaultValueOpt, annotations)
49+
new ParameterInfos(name, typeName, Some(doc), defaultValueGetterOpt, annotations)
5050

5151
def withAnnotations(annots: ParameterAnnotation*): ParameterInfos[T] =
52-
new ParameterInfos(name, typeName, documentation, defaultValueOpt, annots)
52+
new ParameterInfos(name, typeName, documentation, defaultValueGetterOpt, annots)
5353

5454
override def toString: String = s"$name: $typeName"
5555
}

library/src/scala/main.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ final class main(maxLineLength: Int) extends MainAnnotation:
244244
checkNamesDuplicates(argShortNamess.last)
245245

246246
override def argGetter[T](paramInfos: ParameterInfos[T])(using p: ArgumentParser[T]): () => T =
247-
val dvOpt = paramInfos.defaultValueOpt
247+
val dvOpt = paramInfos.defaultValueGetterOpt
248248
registerArg(paramInfos, if dvOpt.nonEmpty then ArgumentKind.OptionalArgument else ArgumentKind.SimpleArgument)
249249

250250
// registerArg placed all infos in the respective buffers

0 commit comments

Comments
 (0)