Skip to content

Add convenience run method that initializes sub commands and type converters #115

@remkop

Description

@remkop

For commands implementing Runnable there currently is a CommandLine::run static convenience method that takes care of some boilerplate error handling:

CommandLine.run(new MyApp(), System.err, args);

Unfortunately this static method does not allow us to register subcommands or custom type converters:

  • subcommands and type converters need to be registered on a CommandLine instance
  • the parsing result is a list of recognized commands. The application logic needs to be given this list to process, which cannot be done via the (parameterless) Runnable::run method.

The purpose of this ticket is to explore possibilities for providing a similar convenience API to applications that have subcommands and custom type converters.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions