Skip to content

Commit 3b8e3de

Browse files
author
John Keyes
committed
fix the first problem that Rob found yesterday wiht helpOptions
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/cli/trunk@129845 13f79535-47bb-0310-9956-ffa450edef68
1 parent 4c34483 commit 3b8e3de

1 file changed

Lines changed: 10 additions & 10 deletions

File tree

src/java/org/apache/commons/cli/Options.java

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,15 @@ public Options addOption(Option opt) {
187187
* @return read-only Collection of {@link Option} objects in this descriptor
188188
*/
189189
public Collection getOptions() {
190+
return Collections.unmodifiableCollection( helpOptions() );
191+
}
192+
193+
/**
194+
* <p>Returns the Options for use by the HelpFormatter.</p>
195+
*
196+
* @return the List of Options
197+
*/
198+
List helpOptions() {
190199
List opts = new ArrayList( shortOpts.values() );
191200

192201
// now look through the long opts to see if there are any Long-opt
@@ -200,16 +209,7 @@ public Collection getOptions() {
200209
opts.add(item);
201210
}
202211
}
203-
return Collections.unmodifiableCollection( opts );
204-
}
205-
206-
/**
207-
* <p>Returns the Options for use by the HelpFormatter.</p>
208-
*
209-
* @return the List of Options
210-
*/
211-
List helpOptions() {
212-
return new ArrayList( shortOpts.values() );
212+
return new ArrayList( opts );
213213
}
214214

215215
/** <p>Returns the required options as a

0 commit comments

Comments
 (0)