File tree Expand file tree Collapse file tree
src/java/org/apache/commons/cli Expand file tree Collapse file tree Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments