[OPENDJ-2027] Command-line tools requiring arguments should display usage if none are given Created: 15/May/15  Updated: 08/Nov/19  Resolved: 27/Jul/15

Status: Done
Project: OpenDJ
Component/s: tools
Affects Version/s: 3.0.0, 2.8.0, 2.6.2
Fix Version/s: 3.0.0

Type: Bug Priority: Minor
Reporter: Lee Trujillo Assignee: Gaetan Boismal [X] (Inactive)
Resolution: Fixed Votes: 0
Labels: release-notes

Dev Assignee: Gaetan Boismal [X] (Inactive)
Support Ticket IDs:

 Description   

Command line tools such as create-rc-script and import-ldif require arguments, but when executed without only give an error message.

$ bin//create-rc-script 
An error occurred while parsing the command-line arguments:  The argument outputfile is required to have a value but 
none was provided in the argument list and no default value is available

$ bin/import-ldif 
Neither the ldifFile or the templateFile argument was provided.  One of these arguments must be given to specify the 
source for the LDIF data to be imported

Unlike the above, the dbtest and dsframework commands actually tells users to use --help to get information on the required arguments.

$ bin/dbtest 
A sub-command must be specified

See "dbtest --help" to get more usage help

These tools as a whole, should be consistent and display the Tool Usage message.
Good Usage Example:

$ bin/make-ldif 
An error occurred while parsing the command-line arguments:  The argument
templatefile is required to have a value but none was provided in the argument
list and no default value is available
This utility can be used to generate LDIF data based on a definition in a
template file

Usage:  make-ldif  {options}
        where {options} include:

-t, --templateFile {file}
    The path to the template file with information about the LDIF data to
    generate
-o, --ldifFile {file}
    The path to the LDIF file to be written
-s, --randomSeed {seed}
    The seed to use to initialize the random number generator
    Default value: 0

General Options

-V, --version
    Display Directory Server version information
-?, -H, --help
    Show this usage information


 Comments   
Comment by Gaetan Boismal [X] (Inactive) [ 20/Jul/15 ]

As discussed in CR-7646 with Matthew Swift, it might be worth to have the dbtest behaviour instead of the make-ldif one.

Comment by Matthew Swift [ 07/Nov/19 ]

Moved to closed state because the fixVersion has already been released.

Generated at Fri Oct 23 09:01:32 UTC 2020 using Jira 7.13.12#713012-sha1:6e07c38070d5191bbf7353952ed38f111754533a.