Open kflorence opened 6 years ago
A simple fix for this might be to just expose def arguments: Seq[Binding[T]]
on the trait.
Until #76 is merged, the following can be used as a workaround:
@tailrec
def getArguments(index: Int, arguments: Seq[Any]): Seq[Any] = {
options.argument(index) match {
case FullBinding(v) => getArguments(index + 1, arguments :+ v)
case VoidBinding => arguments
}
}
HelperOptions[T]
trait provides theargument
method, which returns a single argument value. Is there any way to get a list of all argument values?My specific use-case is building an i18n helper method which will accept a key, a language, and a variable list of arguments to substitute in the message.