Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
odisseus opened this issue Oct 7, 2024 · 0 comments
Open

Comments

@odisseus
Copy link

odisseus commented Oct 7, 2024

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant