jkeyes      2004/03/06 13:45:15

  Modified:    cli/src/java/org/apache/commons/cli2/impl Tag:
                        RESEARCH_CLI_2_ROXSPRING GroupImpl.java
  Log:
  - housekeeping

    . group help methods

    . removed couldBeAnOption method, now calls CommandLine.looksLikeOption
  
  Revision  Changes    Path
  No                   revision
  No                   revision
  1.1.2.13  +19 -30    
jakarta-commons/cli/src/java/org/apache/commons/cli2/impl/Attic/GroupImpl.java
  
  Index: GroupImpl.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-commons/cli/src/java/org/apache/commons/cli2/impl/Attic/GroupImpl.java,v
  retrieving revision 1.1.2.12
  retrieving revision 1.1.2.13
  diff -u -r1.1.2.12 -r1.1.2.13
  --- GroupImpl.java    6 Mar 2004 20:47:56 -0000       1.1.2.12
  +++ GroupImpl.java    6 Mar 2004 21:45:15 -0000       1.1.2.13
  @@ -182,7 +182,7 @@
                   // it might be an anonymous argument continue search
                   
                   // [START argument may be anonymous
  -                if (couldBeAnOption(arg)) {
  +                if (commandLine.looksLikeOption(arg)) {
                       
                       // narrow the search
                       final Collection values = optionMap.tailMap(arg).values();
  @@ -263,6 +263,24 @@
       /*
        * (non-Javadoc)
        * 
  +     * @see org.apache.commons.cli2.Option#getPreferredName()
  +     */
  +    public String getPreferredName() {
  +        return name;
  +    }
  +
  +    /*
  +     * (non-Javadoc)
  +     * 
  +     * @see org.apache.commons.cli2.Option#getDescription()
  +     */
  +    public String getDescription() {
  +        return description;
  +    }
  +
  +    /*
  +     * (non-Javadoc)
  +     * 
        * @see org.apache.commons.cli2.Option#appendUsage(java.lang.StringBuffer,
        *      java.util.Set, java.util.Comparator)
        */
  @@ -369,19 +387,6 @@
           }
       }
   
  -    public String getPreferredName() {
  -        return name;
  -    }
  -
  -    /*
  -     * (non-Javadoc)
  -     * 
  -     * @see org.apache.commons.cli2.Option#getDescription()
  -     */
  -    public String getDescription() {
  -        return description;
  -    }
  -
       /*
        * (non-Javadoc)
        * 
  @@ -426,22 +431,6 @@
               }
           }
           return helpLines;
  -    }
  -
  -    /**
  -     * Returns whether the specified argument may be an option
  -     * 
  -     * @param token A command line token
  -     * @return whether the token may be an option
  -     */
  -    private boolean couldBeAnOption(final String token) {
  -        for (Iterator iter = this.prefixes.iterator(); iter.hasNext();) {
  -            final String prefix = (String) iter.next();
  -            if (token.startsWith(prefix)) {
  -                return true;
  -            }
  -        }
  -        return false;
       }
   }
   
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to