You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by jk...@apache.org on 2002/09/09 21:35:24 UTC

cvs commit: jakarta-commons/cli/src/java/org/apache/commons/cli PosixParser.java

jkeyes      2002/09/09 12:35:24

  Modified:    cli/src/java/org/apache/commons/cli PosixParser.java
  Log:
  added support for special long options like in ls
  
  Revision  Changes    Path
  1.10      +12 -5     jakarta-commons/cli/src/java/org/apache/commons/cli/PosixParser.java
  
  Index: PosixParser.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/cli/src/java/org/apache/commons/cli/PosixParser.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- PosixParser.java	26 Aug 2002 20:15:02 -0000	1.9
  +++ PosixParser.java	9 Sep 2002 19:35:24 -0000	1.10
  @@ -153,7 +153,14 @@
   
               // handle SPECIAL TOKEN
               if( token.startsWith( "--" ) ) {
  -                tokens.add( token );
  +                if( token.indexOf( '=' ) != -1 ) {
  +                    tokens.add( token.substring( 0, token.indexOf( '=' ) ) );
  +                    tokens.add( token.substring( token.indexOf( '=' ) + 1,
  +                                                 token.length() ) );
  +                }
  +                else {
  +                    tokens.add( token );
  +                }	
               }
               // single hyphen
               else if( "-".equals( token ) ) {
  
  
  

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>