Looking for the latest version? Download argparse4j-0.4.3.jar (81.7 kB)
Home / argparse4j-0.4.0
Name Modified Size Downloads / Week Status
Parent folder
Totals: 4 Items   523.1 kB 3
README.rst 2013-02-21 2.6 kB
argparse4j-0.4.0-javadoc.jar 2013-02-21 354.5 kB 11 weekly downloads
argparse4j-0.4.0.jar 2013-02-21 80.7 kB 11 weekly downloads
argparse4j-0.4.0-sources.jar 2013-02-21 85.3 kB 11 weekly downloads

argparse4j 0.4.0

Release Note

This release fixes the bug that argument is processed twice with concatenated short options. The following new features were added: argument/sub-command abbreviations, usage text override, ${prog} substitution in version text, sub-command aliases and count() action. If neither title nor description are specified to MutuallyExclusiveGroup, the help message for the group is merged into other optinal arguments. The Argument.type(Class) now supports valueOf(String) static method for conversion. It also now supports enums directly. The behavior of nargs("*") for optional arguments are slightly changed for some corner-cases. See the changes for details.

Changes

  • Show command aliases in help message

  • Avoid \n and use %n or TextHelper.LINESEP instead

  • Add CountArgumentAction

    CountArgumentAction counts the number of occurrence of an option. Arguments.count() returns the instance of this object for shortcut.

  • Support ${prog} substitution in version string

  • Add ArgumentParser.usage()

    By default, the program usage is generated from the arguments the ArgumentParser object contains. This method overrides it.

  • Add ArgumentParser.addMutuallyExclusiveGroup() without title arg

    If both title and description are empty, the help message for the group is merged into other optional arguments.

  • Don't show available enum constants when conversion failed

    If they are shown, user may be confused with choices because choices may be more limited.

  • Add ReflectArgumentType

    ReflectArgumentType is an enhanced version of ConstructorArgumentType. It first tries to convert given String to desired type using valueOf static method of the type. If it failed, use the constructor of given type just like a ConstructorArgumentType. Since enums have valueOf static method, ReflectArgumentType works with enums as well. The ReflectArgumentType effectively deprecates ConstructorArgumentType and EnumArgumentType.

  • Throw exception if no nameOrFlags is given

  • Support argument/sub-command abbreviations

  • Adjust narg("*") handling for optinal arguments

    The optional argument with nargs("*") and without default set is not given in command-line, the result is now null instead of empty list.

    The optional argument with nargs("*") is given in command-line with emtpy list, the result is now empty list. It will overwrite existing value or appened to the existing list in case of append() action.

  • Fix bug that argument is processed twice with concatenated short options

Source: README.rst, updated 2013-02-21