Args trait can be mixed into an object to provide an argument-based main method. Simply mix in this trait and define
a main method with named arguments and default values to allow instantiation to occur dynamically.
For example:
def main(name: String, count: Int = 5) = {
}
May be invoked via the following command-line invocation:
ArgsClass --name "John Doe" --count 25
Excluding arg names will place them at the first undefined position without a default value. If required values are
excluded the method will be run with type defaults (null for refs).
Args trait can be mixed into an object to provide an argument-based main method. Simply mix in this trait and define a main method with named arguments and default values to allow instantiation to occur dynamically.
For example: def main(name: String, count: Int = 5) = { }
May be invoked via the following command-line invocation: ArgsClass --name "John Doe" --count 25
Excluding arg names will place them at the first undefined position without a default value. If required values are excluded the method will be run with type defaults (null for refs).