cddd676de138668ef547099bba407d8b302a1507 3210 |
|
26-Sep-2007 |
kenneth_suter |
Addresses issue 2143 which is intended to help with the readability of the usage statements by allowing options to be grouped logically by type. Many of the utilities arguments have grown to such an extent that it is difficult to sort through the various types of arguments to find what you are looking for. For instance the usage statement for the task schedulable arguments are mixed with the LDAP connection arguments which makes them difficult to ignore if they want to use the tool in offline mode.
This code also make consistent the position of standard options (e.g. help, version, quiet, verbose) within usage statements.
ArgumentParser (and SubCommandArgumentParse) have 4 built-in groups: General Options (for help and version commands), LDAP Connection Options (e.g. host, port), Utility Input/Output Options (e.g. quiet, verbose, no-prompt, argument file etc) and default options (for ungrouped arguments). The default group appears first in the list without a header to maintain backward consistency. Other groups can be defined for a usage statement by supplying an ArgumentGroup to the addArgument() method. |