Types of commandline structure

Commandline parametrization can be structured in many ways. The class BasicArgsParser implements support for those most useful ones; however, the component design allows to reuse most args-inject code (gathering declaration) when implementing another parser.

Following sections describe the what BasicArgsParser currently supports:


  • no subcommand - whole application has single functionality
  • some options
  • examples: wget, cat, head, ... simply most Unix utilities
  • sample code: MyPathTool


  • multiple subcommands supported, one per execution, command-specific parameters
  • global options, command-specific options
  • options (with their values) can occur anywhere with respect to command and its parameters
  • examples: svn
  • sample code:

Multicommand (not supported yet)

  • multiple commands supported, multiple in execution
  • no known example - just possible
  • the idea is something like this:

    mythreadmanager --config /etc/mtm.xml mailProcessingThread --only-text-mails jmsProcessingThread --jmsType=binary