Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@
<version>1.7.0</version>
</dependency>
<dependency>
<groupId>commons-lang</groupId>
<artifactId>commons-lang</artifactId>
<version>2.4</version>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.4</version>
</dependency>
<dependency>
<groupId>commons-logging</groupId>
Expand All @@ -39,7 +39,7 @@
<dependency>
<groupId>org.cyclopsgroup</groupId>
<artifactId>caff</artifactId>
<version>0.3</version>
<version>0.4.0</version>
</dependency>
<dependency>
<groupId>jline</groupId>
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/cyclopsgroup/jcli/ValidationResult.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import java.util.Collections;
import java.util.List;

import org.apache.commons.lang.Validate;
import org.apache.commons.lang3.Validate;

/**
* Argument validation result coming from {@link ArgumentProcessor#validate(String[])}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import java.util.Date;
import java.util.List;

import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.cyclopsgroup.caff.conversion.DateField;
import org.cyclopsgroup.jcli.ArgumentProcessor;
import org.cyclopsgroup.jcli.annotation.Argument;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package org.cyclopsgroup.jcli.impl;

import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.HashCodeBuilder;
import org.cyclopsgroup.jcli.annotation.Option;

class AnnotationOption
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import java.io.IOException;
import java.io.PrintWriter;

import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang3.StringUtils;
import org.cyclopsgroup.caff.format.Format;
import org.cyclopsgroup.caff.format.Formats;
import org.cyclopsgroup.jcli.spi.Option;
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/cyclopsgroup/jcli/impl/OptionHelp.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package org.cyclopsgroup.jcli.impl;

import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang3.StringUtils;
import org.cyclopsgroup.caff.format.FixLengthField;
import org.cyclopsgroup.caff.format.FixLengthType;
import org.cyclopsgroup.jcli.spi.Option;
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/cyclopsgroup/jcli/impl/Reference.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package org.cyclopsgroup.jcli.impl;

import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.cyclopsgroup.caff.conversion.Converter;
import org.cyclopsgroup.caff.ref.ValueReference;

Expand Down
24 changes: 12 additions & 12 deletions src/main/java/org/cyclopsgroup/jcli/jline/CliCompletor.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@

import jline.console.completer.Completer;

import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang.Validate;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.Validate;
import org.cyclopsgroup.caff.token.TokenEvent;
import org.cyclopsgroup.caff.token.TokenEventHandler;
import org.cyclopsgroup.caff.token.ValueTokenizer;
Expand All @@ -25,7 +25,7 @@
* @author <a href="mailto:jiaqi.guo@gmail.com">Jiaqi Guo</a>
*/
public class CliCompletor
implements Completer
implements Completer
{
private static List<String> filterList( List<String> list, String prefix )
{
Expand Down Expand Up @@ -60,7 +60,7 @@ public CliCompletor( final Object cliBean, final ValueTokenizer tokenizer )
Validate.notNull( cliBean, "Cli bean can't be NULL" );
Validate.notNull( tokenizer, "String tokenizer can't be NULL" );
context =
ArgumentProcessor.newInstance( cliBean.getClass() ).createParsingContext();
ArgumentProcessor.newInstance( cliBean.getClass() ).createParsingContext();
if ( cliBean instanceof AutoCompletable )
{
this.completable = (AutoCompletable) cliBean;
Expand Down Expand Up @@ -133,11 +133,11 @@ public void handleEvent( TokenEvent ev )
case OPTION:
case LONG_OPTION:
candidates.addAll( suggestOptionNames( inspector,
inspector.getCurrentValue() ) );
inspector.getCurrentValue() ) );
break;
case OPTION_VALUE:
candidates.addAll( suggestOptionValue( inspector.getCurrentOption(),
inspector.getCurrentValue() ) );
inspector.getCurrentValue() ) );
break;
case ARGUMENT:
candidates.addAll( suggestArguments( inspector.getCurrentValue() ) );
Expand Down Expand Up @@ -170,7 +170,7 @@ private List<String> suggestArguments( String partialArgument )
if ( results == null )
{
results =
filterList( completable.suggestArgument( null ),
filterList( completable.suggestArgument( null ),
partialArgument );
}
}
Expand All @@ -193,12 +193,12 @@ private List<String> suggestOptionNames( ArgumentsInspector inspector,
for ( Option o : inspector.getRemainingOptions() )
{
if ( value.startsWith( "--" ) && o.getLongName() != null
&& ( "--" + o.getLongName() ).startsWith( value ) )
&& ( "--" + o.getLongName() ).startsWith( value ) )
{
results.add( "--" + o.getLongName() );
}
else if ( value.startsWith( "-" )
&& ( "-" + o.getName() ).startsWith( value ) )
&& ( "-" + o.getName() ).startsWith( value ) )
{
results.add( "-" + o.getName() );
}
Expand All @@ -217,12 +217,12 @@ private List<String> suggestOptionValue( Option option, String partialValue )
else
{
results =
completable.suggestOption( option.getName(), partialValue );
completable.suggestOption( option.getName(), partialValue );
if ( results == null )
{
results =
filterList( completable.suggestOption( option.getName(),
null ), partialValue );
filterList( completable.suggestOption( option.getName(),
null ), partialValue );
}
}
if ( results == null )
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/cyclopsgroup/jcli/spi/CommandLine.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import java.util.ArrayList;
import java.util.List;

import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringBuilder;

/**
* Data that comes from command arguments
Expand Down
2 changes: 1 addition & 1 deletion src/test/java/org/cyclopsgroup/jcli/Simple.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import java.util.Arrays;
import java.util.List;

import org.apache.commons.lang.builder.ReflectionToStringBuilder;
import org.apache.commons.lang3.builder.ReflectionToStringBuilder;
import org.cyclopsgroup.jcli.annotation.Argument;
import org.cyclopsgroup.jcli.annotation.Cli;
import org.cyclopsgroup.jcli.annotation.MultiValue;
Expand Down