Skip to content

Subcommand methods are not processed when placed after the main method #166

Open
@odisseus

Description

@odisseus

Example 1

(Works as expected)

object Main{
  @main def bar() = {}  
  @main def foo() = {}
  def main(args: Array[String]): Unit = ParserForMethods(this).runOrExit(args)
}
$ java -cp ... Main --help
Available subcommands:
  bar
  foo

Example 2

(Note that the subcommand foo is missing)

object Main{
  @main def bar() = {}  
  def main(args: Array[String]): Unit = ParserForMethods(this).runOrExit(args)
  @main def foo() = {}
}
$ java -cp ... Main --help
Available subcommands:
  bar

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions