From 0c41649927fe66913e2e3168f69e671bf7199987 Mon Sep 17 00:00:00 2001
From: lutoff <lutoff@localhost>
Date: Wed, 04 Apr 2007 07:46:18 +0000
Subject: [PATCH] Fix CLI consistency issues: 1407 1408 1410 1411 1412 1413 1414 1416 1417 1418 1419 1420 1421
---
opends/src/server/org/opends/server/util/args/ArgumentParser.java | 10 ++++------
1 files changed, 4 insertions(+), 6 deletions(-)
diff --git a/opends/src/server/org/opends/server/util/args/ArgumentParser.java b/opends/src/server/org/opends/server/util/args/ArgumentParser.java
index b80ec4c..86289e7 100644
--- a/opends/src/server/org/opends/server/util/args/ArgumentParser.java
+++ b/opends/src/server/org/opends/server/util/args/ArgumentParser.java
@@ -1020,6 +1020,7 @@
// Write a line with the short and/or long identifiers that may be used
// for the argument.
Character shortID = a.getShortIdentifier();
+ String longID = a.getLongIdentifier();
if (shortID != null)
{
int currentLength = buffer.length();
@@ -1027,17 +1028,16 @@
buffer.append("-");
buffer.append(shortID.charValue());
- if (a.needsValue())
+ if (a.needsValue() && longID == null)
{
buffer.append(" ");
buffer.append(a.getValuePlaceholder());
}
- String longID = a.getLongIdentifier();
if (longID != null)
{
StringBuilder newBuffer = new StringBuilder();
- newBuffer.append("or --");
+ newBuffer.append(", --");
newBuffer.append(longID);
if (a.needsValue())
@@ -1046,7 +1046,7 @@
newBuffer.append(a.getValuePlaceholder());
}
- int lineLength = (buffer.length() - currentLength) + 2 +
+ int lineLength = (buffer.length() - currentLength) +
newBuffer.length();
if (lineLength > 80)
{
@@ -1055,7 +1055,6 @@
}
else
{
- buffer.append(" ");
buffer.append(newBuffer.toString());
}
}
@@ -1064,7 +1063,6 @@
}
else
{
- String longID = a.getLongIdentifier();
if (longID != null)
{
buffer.append("--");
--
Gitblit v1.10.0