From 4bf3814d7eefb7ce4e17af501c3711e1b21b5e67 Mon Sep 17 00:00:00 2001
From: kenneth_suter <kenneth_suter@localhost>
Date: Wed, 26 Sep 2007 15:56:11 +0000
Subject: [PATCH] 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.
---
opends/src/server/org/opends/server/util/args/LDAPConnectionArgumentParser.java | 23 ++++++++++++++++-------
1 files changed, 16 insertions(+), 7 deletions(-)
diff --git a/opends/src/server/org/opends/server/util/args/LDAPConnectionArgumentParser.java b/opends/src/server/org/opends/server/util/args/LDAPConnectionArgumentParser.java
index 7c11439..fecee2e 100644
--- a/opends/src/server/org/opends/server/util/args/LDAPConnectionArgumentParser.java
+++ b/opends/src/server/org/opends/server/util/args/LDAPConnectionArgumentParser.java
@@ -64,13 +64,17 @@
* tool, which will be included when
* displaying usage information.
* @param longArgumentsCaseSensitive Indicates whether long arguments should
- * be treated in a case-sensitive manner.
+ * @param argumentGroup Group to which LDAP arguments will be
+ * added to the parser. May be null to
+ * indicate that arguments should be
+ * added to the default group
*/
public LDAPConnectionArgumentParser(String mainClassName,
Message toolDescription,
- boolean longArgumentsCaseSensitive) {
+ boolean longArgumentsCaseSensitive,
+ ArgumentGroup argumentGroup) {
super(mainClassName, toolDescription, longArgumentsCaseSensitive);
- addLdapConnectionArguments();
+ addLdapConnectionArguments(argumentGroup);
}
/**
@@ -103,6 +107,10 @@
* as a placeholder for unnamed trailing
* arguments in the generated usage
* information.
+ * @param argumentGroup Group to which LDAP arguments will be
+ * added to the parser. May be null to
+ * indicate that arguments should be
+ * added to the default group
*/
public LDAPConnectionArgumentParser(String mainClassName,
Message toolDescription,
@@ -110,11 +118,12 @@
boolean allowsTrailingArguments,
int minTrailingArguments,
int maxTrailingArguments,
- String trailingArgsDisplayName) {
+ String trailingArgsDisplayName,
+ ArgumentGroup argumentGroup) {
super(mainClassName, toolDescription, longArgumentsCaseSensitive,
allowsTrailingArguments, minTrailingArguments, maxTrailingArguments,
trailingArgsDisplayName);
- addLdapConnectionArguments();
+ addLdapConnectionArguments(argumentGroup);
}
/**
@@ -397,12 +406,12 @@
return args;
}
- private void addLdapConnectionArguments() {
+ private void addLdapConnectionArguments(ArgumentGroup argGroup) {
args = new SecureConnectionCliArgs();
try {
LinkedHashSet<Argument> argSet = args.createGlobalArguments();
for (Argument arg : argSet) {
- addArgument(arg);
+ addArgument(arg, argGroup);
}
}
catch (ArgumentException ae) {
--
Gitblit v1.10.0