Skip to content

Commit 500e99f

Browse files
author
John Keyes
committed
pr14768 - modified so it can only be added to the required option list once
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/cli/trunk@129870 13f79535-47bb-0310-9956-ffa450edef68
1 parent 3fd1eb0 commit 500e99f

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,8 +184,11 @@ public Options addOption(Option opt)
184184
}
185185

186186
// if the option is required add it to the required list
187-
if (opt.isRequired() && !requiredOpts.contains(key))
187+
if (opt.isRequired() )
188188
{
189+
if( requiredOpts.contains(key) ) {
190+
requiredOpts.remove( requiredOpts.indexOf(key) );
191+
}
189192
requiredOpts.add(key);
190193
}
191194

0 commit comments

Comments
 (0)