Skip to content

Refactoring of help and parse

Thomas Flori requested to merge refactoring into 3.0

Created by: tflori

Several improvements to the code are now possible. Also we improved some things already with this refactoring:

  • Custom templates for usage and options through Help class
  • Custom help formatter class through Getopt::setHelp()
  • Pass Argument in Option constructor
  • Argument mode MULTIPLE_ARGUMENT added
  • Padding determined automatically (through default template)
  • Line length determined automatically and description indented (through default template)
  • Allowing ?!§$%# as short option names

This refactoring also brings some breaking changes:

  • The second parameter for Getopt constructor is now an array of settings
  • Getopt::setBanner() and Getopt::getBanner() are removed
  • Options can't be overwritten instead you have to get the option instance and change it

Merge request reports