0fd845d18cfaf23fc9f54e92775c735955e4e859 |
|
27-Jul-2015 |
Gaetan Boismal <gaetan.boismal@forgerock.com> |
OPENDJ-2027 CR-7646 Change tools message on error
This commit makes all tools consistent in the way that if no arguments are provided on the command line (or only the non prompt argument for interactive tools), tool prints the error and the help reference message on error stream.
Changes details:
* ArgumentParser
** Create method displayMessageAndUsageReference(), this method is used by tools to print both an error message and the help usage reference message
** getHelpUsageReference() has been moved from SubCommandArgumentParser
* DSConfig
** displayErrorMessageAndUsageReference() has been moved to ArgumentParser
* CreateRCScript
** Moves the server root path check after the argument parsing in order to have a consistent error message if arguments are invalid.
* RebuildIndex
* VerifyIndex
** Removed dead code which printed usage if no args were provided (if so, an argument exception is raised before).
* MakeLDIF
** Add a main method for test purpose
* ArgumentParserToolsTestCase
** Test that tools are consistent if an invalid argument is provided or if no args are provided.
Tools modified by this commit are the following:
Server tools
* Does not print usage anymore
** backup
** base64 (only if no args are provided)
** control-panel
** create-rc-script
** dbtest
** dsjavaproperties
** dsreplication
** encode-password
** export-ldif
** import-ldif
** ldapcompare
** ldapdelete
** ldapmodify
** ldappasswordmodify
** ldapsearch
** ldif-diff
** ldifmodify
** ldifsearch
** make-ldif
** manage-account
** manage-tasks
** rebuild-index
** restore
** setup
** start-ds
** status
** stop-ds
** uninstall
** upgrade
** verify-index
* Usage reference message added
** base64 (only if invalid args are provided)
SDK tools
* Does not print usage anymore
** addrate
** makeldif
* Usage reference message added
** authrate
** ldapcompare
** ldapmodify
** ldappasswordmodify
** ldapsearch
** ldifdiff
** ldifmodify
** ldifsearch
** modrate
** searchrate |