You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by se...@apache.org on 2007/04/15 19:22:42 UTC
svn commit: r529021 - in
/jakarta/commons/proper/cli/branches/avalon-implementation/src/java/org/apache/commons/cli/avalon:
AbstractParserControl.java CLArgsParser.java CLOption.java
CLOptionDescriptor.java CLUtil.java ParserControl.java Token.java
Author: sebb
Date: Sun Apr 15 10:22:41 2007
New Revision: 529021
URL: http://svn.apache.org/viewvc?view=rev&rev=529021
Log:
Fix ASF licence; add NON-NLS markers
Modified:
jakarta/commons/proper/cli/branches/avalon-implementation/src/java/org/apache/commons/cli/avalon/AbstractParserControl.java
jakarta/commons/proper/cli/branches/avalon-implementation/src/java/org/apache/commons/cli/avalon/CLArgsParser.java
jakarta/commons/proper/cli/branches/avalon-implementation/src/java/org/apache/commons/cli/avalon/CLOption.java
jakarta/commons/proper/cli/branches/avalon-implementation/src/java/org/apache/commons/cli/avalon/CLOptionDescriptor.java
jakarta/commons/proper/cli/branches/avalon-implementation/src/java/org/apache/commons/cli/avalon/CLUtil.java
jakarta/commons/proper/cli/branches/avalon-implementation/src/java/org/apache/commons/cli/avalon/ParserControl.java
jakarta/commons/proper/cli/branches/avalon-implementation/src/java/org/apache/commons/cli/avalon/Token.java
Modified: jakarta/commons/proper/cli/branches/avalon-implementation/src/java/org/apache/commons/cli/avalon/AbstractParserControl.java
URL: http://svn.apache.org/viewvc/jakarta/commons/proper/cli/branches/avalon-implementation/src/java/org/apache/commons/cli/avalon/AbstractParserControl.java?view=diff&rev=529021&r1=529020&r2=529021
==============================================================================
--- jakarta/commons/proper/cli/branches/avalon-implementation/src/java/org/apache/commons/cli/avalon/AbstractParserControl.java (original)
+++ jakarta/commons/proper/cli/branches/avalon-implementation/src/java/org/apache/commons/cli/avalon/AbstractParserControl.java Sun Apr 15 10:22:41 2007
@@ -1,26 +1,28 @@
-/*
- * Copyright 2002-2005 The Apache Software Foundation
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied.
- *
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
+ *
*/
+
package org.apache.commons.cli.avalon;
//Renamed from org.apache.avalon.excalibur.cli
/**
* Class to inherit from so when in future when new controls are added
- * clients will no have to implement them.
- * @version $Revision: 1.2 $
+ * clients will not have to implement them.
+ *
* @see ParserControl
*/
public abstract class AbstractParserControl
Modified: jakarta/commons/proper/cli/branches/avalon-implementation/src/java/org/apache/commons/cli/avalon/CLArgsParser.java
URL: http://svn.apache.org/viewvc/jakarta/commons/proper/cli/branches/avalon-implementation/src/java/org/apache/commons/cli/avalon/CLArgsParser.java?view=diff&rev=529021&r1=529020&r2=529021
==============================================================================
--- jakarta/commons/proper/cli/branches/avalon-implementation/src/java/org/apache/commons/cli/avalon/CLArgsParser.java (original)
+++ jakarta/commons/proper/cli/branches/avalon-implementation/src/java/org/apache/commons/cli/avalon/CLArgsParser.java Sun Apr 15 10:22:41 2007
@@ -1,19 +1,21 @@
-/*
- * Copyright 2002-2005 The Apache Software Foundation
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied.
- *
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
+ *
*/
+
package org.apache.commons.cli.avalon;
//Renamed from org.apache.avalon.excalibur.cli
@@ -32,7 +34,6 @@
* Note that CLArgs uses a backing hashtable for the options index and so duplicate
* arguments are only returned by getArguments().
*
- * @version $Revision: 1.2 $ $Date: 2005/03/18 15:26:55 $
* @see ParserControl
* @see CLOption
* @see CLOptionDescriptor
@@ -330,7 +331,7 @@
if( Character.isLetter( (char)id ) )
{
- sb.append( '-' );
+ sb.append( '-' ); // $NON-NLS-1$
sb.append( (char)id );
hasCharOption = true;
}
@@ -340,9 +341,9 @@
{
if( hasCharOption )
{
- sb.append( '/' );
+ sb.append( '/' ); // $NON-NLS-1$
}
- sb.append( "--" );
+ sb.append( "--" ); // $NON-NLS-1$
sb.append( longOption );
}
@@ -478,7 +479,7 @@
{
if( 1 == m_option.getArgumentCount() )
{
- m_option.addArgument( "" );
+ m_option.addArgument( "" ); // $NON-NLS-1$
m_options.addElement( m_option );
}
else
@@ -501,11 +502,11 @@
{
if( m_isLong )
{
- return "--" + descriptor.getName();
+ return "--" + descriptor.getName(); // $NON-NLS-1$
}
else
{
- return "-" + (char)descriptor.getId();
+ return "-" + (char)descriptor.getId(); // $NON-NLS-1$
}
}
@@ -625,7 +626,7 @@
m_ch = getChar();
final CLOptionDescriptor descriptor = getDescriptorFor( m_ch );
m_isLong = false;
- parseOption( descriptor, "-" + m_ch );
+ parseOption( descriptor, "-" + m_ch ); // $NON-NLS-1$
if( STATE_NORMAL == m_state )
{
@@ -638,7 +639,7 @@
{
if( STATE_REQUIRE_ARG == m_state )
{
- if( '=' == m_ch || 0 == m_ch )
+ if( '=' == m_ch || 0 == m_ch ) // $NON-NLS-1$
{
getChar();
}
@@ -651,7 +652,7 @@
}
else if( STATE_OPTIONAL_ARG == m_state )
{
- if( '-' == m_ch || 0 == m_ch )
+ if( '-' == m_ch || 0 == m_ch ) // $NON-NLS-1$
{
getChar(); //consume stray character
addOption( m_option );
@@ -659,7 +660,7 @@
return;
}
- if( '=' == m_ch )
+ if( '=' == m_ch ) // $NON-NLS-1$
{
getChar();
}
@@ -700,9 +701,9 @@
m_option.addArgument( token.getValue() );
}
// Are we about to start a new option?
- if (0 == m_ch && '-' == peekAtChar()){
+ if (0 == m_ch && '-' == peekAtChar()){ // $NON-NLS-1$
// Yes, so the second argument is missing
- m_option.addArgument( "" );
+ m_option.addArgument( "" ); // $NON-NLS-1$
m_options.addElement( m_option );
m_state = STATE_NORMAL;
}
@@ -736,7 +737,7 @@
private final void parseNormal()
throws ParseException
{
- if( '-' != m_ch )
+ if( '-' != m_ch ) // $NON-NLS-1$
{
//Parse the arguments that are not options
final String argument = nextToken( NULL_SEPARATORS ).getValue();
@@ -756,7 +757,7 @@
m_ch = peekAtChar();
//if it is a short option then parse it else ...
- if( '-' != m_ch )
+ if( '-' != m_ch ) // $NON-NLS-1$
{
parseShortOption();
}
@@ -777,7 +778,7 @@
final String optionName = nextToken( ARG_SEPARATORS ).getValue();
final CLOptionDescriptor descriptor = getDescriptorFor( optionName );
m_isLong = true;
- parseOption( descriptor, "--" + optionName );
+ parseOption( descriptor, "--" + optionName ); // $NON-NLS-1$
}
}
}
Modified: jakarta/commons/proper/cli/branches/avalon-implementation/src/java/org/apache/commons/cli/avalon/CLOption.java
URL: http://svn.apache.org/viewvc/jakarta/commons/proper/cli/branches/avalon-implementation/src/java/org/apache/commons/cli/avalon/CLOption.java?view=diff&rev=529021&r1=529020&r2=529021
==============================================================================
--- jakarta/commons/proper/cli/branches/avalon-implementation/src/java/org/apache/commons/cli/avalon/CLOption.java (original)
+++ jakarta/commons/proper/cli/branches/avalon-implementation/src/java/org/apache/commons/cli/avalon/CLOption.java Sun Apr 15 10:22:41 2007
@@ -1,19 +1,21 @@
-/*
- * Copyright 2002-2005 The Apache Software Foundation
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied.
- *
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
+ *
*/
+
package org.apache.commons.cli.avalon;
// Renamed from org.apache.avalon.excalibur.cli
@@ -22,7 +24,6 @@
/**
* Basic class describing an instance of option.
*
- * @version $Revision: 1.2 $ $Date: 2005/03/18 15:26:55 $
*/
public final class CLOption
{
@@ -162,11 +163,11 @@
if( null != m_arguments )
{
- sb.append( ", " );
+ sb.append( ", " ); // $NON-NLS-1$
sb.append( Arrays.asList( m_arguments ) );
}
- sb.append( " ]" );
+ sb.append( " ]" ); // $NON-NLS-1$
return sb.toString();
}
Modified: jakarta/commons/proper/cli/branches/avalon-implementation/src/java/org/apache/commons/cli/avalon/CLOptionDescriptor.java
URL: http://svn.apache.org/viewvc/jakarta/commons/proper/cli/branches/avalon-implementation/src/java/org/apache/commons/cli/avalon/CLOptionDescriptor.java?view=diff&rev=529021&r1=529020&r2=529021
==============================================================================
--- jakarta/commons/proper/cli/branches/avalon-implementation/src/java/org/apache/commons/cli/avalon/CLOptionDescriptor.java (original)
+++ jakarta/commons/proper/cli/branches/avalon-implementation/src/java/org/apache/commons/cli/avalon/CLOptionDescriptor.java Sun Apr 15 10:22:41 2007
@@ -1,19 +1,21 @@
-/*
- * Copyright 2002-2005 The Apache Software Foundation
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied.
- *
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
+ *
*/
+
package org.apache.commons.cli.avalon;
//Renamed from org.apache.avalon.excalibur.cli
@@ -22,7 +24,6 @@
* Typically, one creates a static array of <code>CLOptionDescriptor</code>s,
* and passes it to {@link CLArgsParser#CLArgsParser(String[], CLOptionDescriptor[])}.
*
- * @version $Revision: 1.2 $ $Date: 2005/03/18 15:26:55 $
* @see CLArgsParser
* @see CLUtil
*/
@@ -212,15 +213,13 @@
final StringBuffer sb = new StringBuffer();
sb.append( "[OptionDescriptor " );
sb.append( m_name );
- sb.append( "[OptionDescriptor " );
- sb.append( m_name );
- sb.append( ", " );
+ sb.append( ", " ); // $NON-NLS-1$
sb.append( m_id );
- sb.append( ", " );
+ sb.append( ", " ); // $NON-NLS-1$
sb.append( m_flags );
- sb.append( ", " );
+ sb.append( ", " ); // $NON-NLS-1$
sb.append( m_description );
- sb.append( " ]" );
+ sb.append( " ]" ); // $NON-NLS-1$
return sb.toString();
}
}
Modified: jakarta/commons/proper/cli/branches/avalon-implementation/src/java/org/apache/commons/cli/avalon/CLUtil.java
URL: http://svn.apache.org/viewvc/jakarta/commons/proper/cli/branches/avalon-implementation/src/java/org/apache/commons/cli/avalon/CLUtil.java?view=diff&rev=529021&r1=529020&r2=529021
==============================================================================
--- jakarta/commons/proper/cli/branches/avalon-implementation/src/java/org/apache/commons/cli/avalon/CLUtil.java (original)
+++ jakarta/commons/proper/cli/branches/avalon-implementation/src/java/org/apache/commons/cli/avalon/CLUtil.java Sun Apr 15 10:22:41 2007
@@ -1,26 +1,27 @@
-/*
- * Copyright 2002-2005 The Apache Software Foundation
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied.
- *
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
+ *
*/
+
package org.apache.commons.cli.avalon;
//Renamed from org.apache.avalon.excalibur.cli
/**
* CLUtil offers basic utility operations for use both internal and external to package.
*
- * @version $Revision: 1.2 $ $Date: 2005/03/18 15:26:55 $
* @see CLOptionDescriptor
*/
public final class CLUtil
@@ -36,7 +37,7 @@
*/
public static final StringBuffer describeOptions( final CLOptionDescriptor[] options )
{
- final String lSep = System.getProperty( "line.separator" );
+ final String lSep = System.getProperty( "line.separator" ); // $NON-NLS-1$
final StringBuffer sb = new StringBuffer();
for( int i = 0; i < options.length; i++ )
@@ -57,11 +58,11 @@
argumentRequired = true;
}
- sb.append( '\t' );
+ sb.append( '\t' ); // $NON-NLS-1$
if( Character.isLetter( ch ) )
{
- sb.append( "-" );
+ sb.append( "-" ); // $NON-NLS-1$
sb.append( ch );
needComma = true;
}
@@ -70,10 +71,10 @@
{
if( needComma )
{
- sb.append( ", " );
+ sb.append( ", " ); // $NON-NLS-1$
}
- sb.append( "--" );
+ sb.append( "--" ); // $NON-NLS-1$
sb.append( name );
}
@@ -95,12 +96,12 @@
description.substring( 0, MAX_DESCRIPTION_COLUMN_LENGTH );
description =
description.substring( MAX_DESCRIPTION_COLUMN_LENGTH );
- sb.append( "\t\t" );
+ sb.append( "\t\t" ); // $NON-NLS-1$
sb.append( descriptionPart );
sb.append( lSep );
}
- sb.append( "\t\t" );
+ sb.append( "\t\t" ); // $NON-NLS-1$
sb.append( description );
sb.append( lSep );
}
Modified: jakarta/commons/proper/cli/branches/avalon-implementation/src/java/org/apache/commons/cli/avalon/ParserControl.java
URL: http://svn.apache.org/viewvc/jakarta/commons/proper/cli/branches/avalon-implementation/src/java/org/apache/commons/cli/avalon/ParserControl.java?view=diff&rev=529021&r1=529020&r2=529021
==============================================================================
--- jakarta/commons/proper/cli/branches/avalon-implementation/src/java/org/apache/commons/cli/avalon/ParserControl.java (original)
+++ jakarta/commons/proper/cli/branches/avalon-implementation/src/java/org/apache/commons/cli/avalon/ParserControl.java Sun Apr 15 10:22:41 2007
@@ -1,26 +1,27 @@
-/*
- * Copyright 2002-2005 The Apache Software Foundation
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied.
- *
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
+ *
*/
+
package org.apache.commons.cli.avalon;
//Renamed from org.apache.avalon.excalibur.cli
/**
* ParserControl is used to control particular behaviour of the parser.
*
- * @version $Revision: 1.2 $ $Date: 2005/03/18 15:26:55 $
* @see AbstractParserControl
*/
public interface ParserControl
Modified: jakarta/commons/proper/cli/branches/avalon-implementation/src/java/org/apache/commons/cli/avalon/Token.java
URL: http://svn.apache.org/viewvc/jakarta/commons/proper/cli/branches/avalon-implementation/src/java/org/apache/commons/cli/avalon/Token.java?view=diff&rev=529021&r1=529020&r2=529021
==============================================================================
--- jakarta/commons/proper/cli/branches/avalon-implementation/src/java/org/apache/commons/cli/avalon/Token.java (original)
+++ jakarta/commons/proper/cli/branches/avalon-implementation/src/java/org/apache/commons/cli/avalon/Token.java Sun Apr 15 10:22:41 2007
@@ -1,27 +1,27 @@
-/*
- * Copyright 2002-2005 The Apache Software Foundation
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied.
- *
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
+ *
*/
+
package org.apache.commons.cli.avalon;
//Renamed from org.apache.avalon.excalibur.cli
/**
* Token handles tokenizing the CLI arguments
*
- * @version $Revision: 1.2 $ $Date: 2005/03/18 15:26:55 $
- * @since 4.0
*/
class Token
{
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org