From 44bce78c5b5e60ea19033f2487f93d91b6c4f99b Mon Sep 17 00:00:00 2001 From: Jamie Thompson Date: Fri, 22 Jul 2022 11:15:08 +0200 Subject: [PATCH] Update main-annotation.md the relation between parameters and supplied arguments seems to be inverted --- docs/_docs/reference/experimental/main-annotation.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/_docs/reference/experimental/main-annotation.md b/docs/_docs/reference/experimental/main-annotation.md index 8a09edca003d..0c60e1050b87 100644 --- a/docs/_docs/reference/experimental/main-annotation.md +++ b/docs/_docs/reference/experimental/main-annotation.md @@ -65,16 +65,16 @@ import scala.util.CommandLineParser.FromString[T] None else if info.hasVarargs then val numPlainArgs = info.parameters.length - 1 - if numPlainArgs <= args.length then + if numPlainArgs > args.length then println("Not enough arguments") None else Some(args) else - if info.parameters.length <= args.length then + if info.parameters.length > args.length then println("Not enough arguments") None - else if info.parameters.length >= args.length then + else if info.parameters.length < args.length then println("Too many arguments") None else