avalon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From blorit...@apache.org
Subject cvs commit: avalon-excalibur/cli/examples/incompat_options IncompatOptions.java
Date Thu, 27 Feb 2003 14:38:05 GMT
bloritsch    2003/02/27 06:38:05

  Modified:    xfc/src/java/org/apache/excalibur/xfc Main.java
               cli/examples/option_arguments OptionArguments.java
               cli/examples/basic BasicCLI.java
               cli/src/test/org/apache/avalon/excalibur/cli/test
                        ClutilTestCase.java
               cli/src/java/org/apache/avalon/excalibur/cli
                        CLArgsParser.java
               cli/examples/no_aliasing NoAlias.java
               cli/examples/incompat_options IncompatOptions.java
  Log:
  Fix deprecation warnings in released code
  
  Revision  Changes    Path
  1.6       +2 -2      avalon-excalibur/xfc/src/java/org/apache/excalibur/xfc/Main.java
  
  Index: Main.java
  ===================================================================
  RCS file: /home/cvs/avalon-excalibur/xfc/src/java/org/apache/excalibur/xfc/Main.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- Main.java	25 Feb 2003 16:28:43 -0000	1.5
  +++ Main.java	27 Feb 2003 14:38:04 -0000	1.6
  @@ -183,7 +183,7 @@
           {
               final CLOption option = (CLOption)options.get( i );
   
  -            switch( option.getId() )
  +            switch( option.getDescriptor().getId() )
               {
                   case CLOption.TEXT_ARGUMENT:
                       // This occurs when a user supplies an unknown argument
  
  
  
  1.3       +1 -1      avalon-excalibur/cli/examples/option_arguments/OptionArguments.java
  
  Index: OptionArguments.java
  ===================================================================
  RCS file: /home/cvs/avalon-excalibur/cli/examples/option_arguments/OptionArguments.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- OptionArguments.java	25 Feb 2003 16:28:25 -0000	1.2
  +++ OptionArguments.java	27 Feb 2003 14:38:05 -0000	1.3
  @@ -73,7 +73,7 @@
           {
               final CLOption option = (CLOption)options.get( i );
   
  -            switch( option.getId() )
  +            switch( option.getDescriptor().getId() )
               {
                   case CLOption.TEXT_ARGUMENT:
                       //This occurs when a user supplies an argument that
  
  
  
  1.3       +1 -1      avalon-excalibur/cli/examples/basic/BasicCLI.java
  
  Index: BasicCLI.java
  ===================================================================
  RCS file: /home/cvs/avalon-excalibur/cli/examples/basic/BasicCLI.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- BasicCLI.java	25 Feb 2003 16:28:51 -0000	1.2
  +++ BasicCLI.java	27 Feb 2003 14:38:05 -0000	1.3
  @@ -70,7 +70,7 @@
           {
               final CLOption option = (CLOption)options.get( i );
   
  -            switch( option.getId() )
  +            switch( option.getDescriptor().getId() )
               {
                   case CLOption.TEXT_ARGUMENT:
                       //This occurs when a user supplies an argument that
  
  
  
  1.17      +65 -64    avalon-excalibur/cli/src/test/org/apache/avalon/excalibur/cli/test/ClutilTestCase.java
  
  Index: ClutilTestCase.java
  ===================================================================
  RCS file: /home/cvs/avalon-excalibur/cli/src/test/org/apache/avalon/excalibur/cli/test/ClutilTestCase.java,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- ClutilTestCase.java	25 Feb 2003 16:28:41 -0000	1.16
  +++ ClutilTestCase.java	27 Feb 2003 14:38:05 -0000	1.17
  @@ -77,13 +77,6 @@
       private static final CLOptionDescriptor YOU =
           new CLOptionDescriptor( "you", CLOptionDescriptor.ARGUMENT_DISALLOWED, YOU_OPT,
"you" );
   
  -    private static final CLOptionDescriptor ALL =
  -        new CLOptionDescriptor( "all",
  -                                CLOptionDescriptor.ARGUMENT_DISALLOWED,
  -                                ALL_OPT,
  -                                "all",
  -                                new int[]{BLEE_OPT} );
  -
       private static final CLOptionDescriptor CLEAR1 =
           new CLOptionDescriptor( "c", CLOptionDescriptor.ARGUMENT_DISALLOWED, CLEAR1_OPT,
"c" );
       private static final CLOptionDescriptor CLEAR2 =
  @@ -97,6 +90,14 @@
                                   CLOptionDescriptor.ARGUMENT_DISALLOWED,
                                   BLEE_OPT,
                                   "blee" );
  +
  +    private static final CLOptionDescriptor ALL =
  +        new CLOptionDescriptor( "all",
  +                                CLOptionDescriptor.ARGUMENT_DISALLOWED,
  +                                ALL_OPT,
  +                                "all",
  +                                new CLOptionDescriptor[]{BLEE} );
  +
       private static final CLOptionDescriptor FILE =
           new CLOptionDescriptor( "file",
                                   CLOptionDescriptor.ARGUMENT_REQUIRED,
  @@ -143,16 +144,16 @@
           assertEquals( "Option count", 3, size );
   
           final CLOption option0 = (CLOption)clOptions.get( 0 );
  -        assertEquals( "Option Code: " + option0.getId(), TAINT_OPT, option0.getId() );
  +        assertEquals( "Option Code: " + option0.getDescriptor().getId(), TAINT_OPT, option0.getDescriptor().getId()
);
           assertEquals( "Option Arg: " + option0.getArgument( 0 ),
                         null, option0.getArgument( 0 ) );
   
           final CLOption option1 = (CLOption)clOptions.get( 1 );
  -        assertEquals( option1.getId(), CLOption.TEXT_ARGUMENT );
  +        assertEquals( option1.getDescriptor().getId(), CLOption.TEXT_ARGUMENT );
           assertEquals( option1.getArgument( 0 ), "param" );
   
           final CLOption option2 = (CLOption)clOptions.get( 2 );
  -        assertEquals( option2.getId(), ALL_OPT );
  +        assertEquals( option2.getDescriptor().getId(), ALL_OPT );
           assertEquals( option2.getArgument( 0 ), null );
       }
   
  @@ -175,11 +176,11 @@
           assertEquals( "Option count", 2, size );
   
           final CLOption option0 = (CLOption)clOptions.get( 0 );
  -        assertEquals( "Option Code: " + option0.getId(), TAINT_OPT, option0.getId() );
  +        assertEquals( "Option Code: " + option0.getDescriptor().getId(), TAINT_OPT, option0.getDescriptor().getId()
);
           assertEquals( "Option Arg: " + option0.getArgument( 0 ), null, option0.getArgument(
0 ) );
   
           final CLOption option1 = (CLOption)clOptions.get( 1 );
  -        assertEquals( option1.getId(), ALL_OPT );
  +        assertEquals( option1.getDescriptor().getId(), ALL_OPT );
           assertEquals( option1.getArgument( 0 ), null );
       }
   
  @@ -206,11 +207,11 @@
   
           assertEquals( size, 2 );
           final CLOption option0 = (CLOption)clOptions.get( 0 );
  -        assertEquals( option0.getId(), TAINT_OPT );
  +        assertEquals( option0.getDescriptor().getId(), TAINT_OPT );
           assertEquals( option0.getArgument( 0 ), "3" );
   
           final CLOption option1 = (CLOption)clOptions.get( 1 );
  -        assertEquals( ALL_OPT, option1.getId() );
  +        assertEquals( ALL_OPT, option1.getDescriptor().getId() );
           assertEquals( null, option1.getArgument( 0 ) );
       }
   
  @@ -236,11 +237,11 @@
   
           assertEquals( size, 2 );
           final CLOption option0 = (CLOption)clOptions.get( 0 );
  -        assertEquals( TAINT_OPT, option0.getId() );
  +        assertEquals( TAINT_OPT, option0.getDescriptor().getId() );
           assertEquals( null, option0.getArgument( 0 ) );
   
           final CLOption option1 = (CLOption)clOptions.get( 1 );
  -        assertEquals( ALL_OPT, option1.getId() );
  +        assertEquals( ALL_OPT, option1.getDescriptor().getId() );
           assertEquals( null, option1.getArgument( 0 ) );
       }
   
  @@ -259,14 +260,14 @@
           final int size = clOptions.size();
   
           assertEquals( size, 8 );
  -        assertEquals( ( (CLOption)clOptions.get( 0 ) ).getId(), YOU_OPT );
  -        assertEquals( ( (CLOption)clOptions.get( 1 ) ).getId(), 0 );
  -        assertEquals( ( (CLOption)clOptions.get( 2 ) ).getId(), ALL_OPT );
  -        assertEquals( ( (CLOption)clOptions.get( 3 ) ).getId(), CLEAR1_OPT );
  -        assertEquals( ( (CLOption)clOptions.get( 4 ) ).getId(), CLEAR2_OPT );
  -        assertEquals( ( (CLOption)clOptions.get( 5 ) ).getId(), CLEAR3_OPT );
  -        assertEquals( ( (CLOption)clOptions.get( 6 ) ).getId(), CLEAR5_OPT );
  -        assertEquals( ( (CLOption)clOptions.get( 7 ) ).getId(), 0 );
  +        assertEquals( ( (CLOption)clOptions.get( 0 ) ).getDescriptor().getId(), YOU_OPT
);
  +        assertEquals( ( (CLOption)clOptions.get( 1 ) ).getDescriptor().getId(), 0 );
  +        assertEquals( ( (CLOption)clOptions.get( 2 ) ).getDescriptor().getId(), ALL_OPT
);
  +        assertEquals( ( (CLOption)clOptions.get( 3 ) ).getDescriptor().getId(), CLEAR1_OPT
);
  +        assertEquals( ( (CLOption)clOptions.get( 4 ) ).getDescriptor().getId(), CLEAR2_OPT
);
  +        assertEquals( ( (CLOption)clOptions.get( 5 ) ).getDescriptor().getId(), CLEAR3_OPT
);
  +        assertEquals( ( (CLOption)clOptions.get( 6 ) ).getDescriptor().getId(), CLEAR5_OPT
);
  +        assertEquals( ( (CLOption)clOptions.get( 7 ) ).getDescriptor().getId(), 0 );
       }
   
       public void testDuplicateOptions()
  @@ -285,11 +286,11 @@
           final int size = clOptions.size();
   
           assertEquals( size, 5 );
  -        assertEquals( ( (CLOption)clOptions.get( 0 ) ).getId(), DEFINE_OPT );
  -        assertEquals( ( (CLOption)clOptions.get( 1 ) ).getId(), 0 );
  -        assertEquals( ( (CLOption)clOptions.get( 2 ) ).getId(), ALL_OPT );
  -        assertEquals( ( (CLOption)clOptions.get( 3 ) ).getId(), ALL_OPT );
  -        assertEquals( ( (CLOption)clOptions.get( 4 ) ).getId(), 0 );
  +        assertEquals( ( (CLOption)clOptions.get( 0 ) ).getDescriptor().getId(), DEFINE_OPT
);
  +        assertEquals( ( (CLOption)clOptions.get( 1 ) ).getDescriptor().getId(), 0 );
  +        assertEquals( ( (CLOption)clOptions.get( 2 ) ).getDescriptor().getId(), ALL_OPT
);
  +        assertEquals( ( (CLOption)clOptions.get( 3 ) ).getDescriptor().getId(), ALL_OPT
);
  +        assertEquals( ( (CLOption)clOptions.get( 4 ) ).getDescriptor().getId(), 0 );
       }
   
       public void testIncompatableOptions()
  @@ -307,11 +308,11 @@
           final int size = clOptions.size();
   
           assertEquals( size, 5 );
  -        assertEquals( ( (CLOption)clOptions.get( 0 ) ).getId(), DEFINE_OPT );
  -        assertEquals( ( (CLOption)clOptions.get( 1 ) ).getId(), 0 );
  -        assertEquals( ( (CLOption)clOptions.get( 2 ) ).getId(), ALL_OPT );
  -        assertEquals( ( (CLOption)clOptions.get( 3 ) ).getId(), BLEE_OPT );
  -        assertEquals( ( (CLOption)clOptions.get( 4 ) ).getId(), 0 );
  +        assertEquals( ( (CLOption)clOptions.get( 0 ) ).getDescriptor().getId(), DEFINE_OPT
);
  +        assertEquals( ( (CLOption)clOptions.get( 1 ) ).getDescriptor().getId(), 0 );
  +        assertEquals( ( (CLOption)clOptions.get( 2 ) ).getDescriptor().getId(), ALL_OPT
);
  +        assertEquals( ( (CLOption)clOptions.get( 3 ) ).getDescriptor().getId(), BLEE_OPT
);
  +        assertEquals( ( (CLOption)clOptions.get( 4 ) ).getDescriptor().getId(), 0 );
       }
   
       public void testSingleArg()
  @@ -329,7 +330,7 @@
           final int size = clOptions.size();
   
           assertEquals( size, 1 );
  -        assertEquals( ( (CLOption)clOptions.get( 0 ) ).getId(), FILE_OPT );
  +        assertEquals( ( (CLOption)clOptions.get( 0 ) ).getDescriptor().getId(), FILE_OPT
);
           assertEquals( ( (CLOption)clOptions.get( 0 ) ).getArgument(), "myfile.txt" );
       }
   
  @@ -349,11 +350,11 @@
           final int size = clOptions.size();
   
           assertEquals( size, 5 );
  -        assertEquals( ( (CLOption)clOptions.get( 0 ) ).getId(), DEFINE_OPT );
  -        assertEquals( ( (CLOption)clOptions.get( 1 ) ).getId(), 0 );
  -        assertEquals( ( (CLOption)clOptions.get( 2 ) ).getId(), ALL_OPT );
  -        assertEquals( ( (CLOption)clOptions.get( 3 ) ).getId(), 0 );
  -        assertEquals( ( (CLOption)clOptions.get( 4 ) ).getId(), CASE_CHECK_OPT );
  +        assertEquals( ( (CLOption)clOptions.get( 0 ) ).getDescriptor().getId(), DEFINE_OPT
);
  +        assertEquals( ( (CLOption)clOptions.get( 1 ) ).getDescriptor().getId(), 0 );
  +        assertEquals( ( (CLOption)clOptions.get( 2 ) ).getDescriptor().getId(), ALL_OPT
);
  +        assertEquals( ( (CLOption)clOptions.get( 3 ) ).getDescriptor().getId(), 0 );
  +        assertEquals( ( (CLOption)clOptions.get( 4 ) ).getDescriptor().getId(), CASE_CHECK_OPT
);
   
           final CLOption option = (CLOption)clOptions.get( 0 );
           assertEquals( "stupid", option.getArgument( 0 ) );
  @@ -383,7 +384,7 @@
           final int size = clOptions.size();
   
           assertEquals( size, 1 );
  -        assertEquals( ( (CLOption)clOptions.get( 0 ) ).getId(), YOU_OPT );
  +        assertEquals( ( (CLOption)clOptions.get( 0 ) ).getDescriptor().getId(), YOU_OPT
);
       }
   
       public void test2PartParse()
  @@ -414,7 +415,7 @@
           final int size1 = clOptions1.size();
   
           assertEquals( size1, 1 );
  -        assertEquals( ( (CLOption)clOptions1.get( 0 ) ).getId(), YOU_OPT );
  +        assertEquals( ( (CLOption)clOptions1.get( 0 ) ).getDescriptor().getId(), YOU_OPT
);
   
           final CLArgsParser parser2 =
               new CLArgsParser( parser1.getUnparsedArgs(), options2 );
  @@ -425,13 +426,13 @@
           final int size2 = clOptions2.size();
   
           assertEquals( size2, 7 );
  -        assertEquals( ( (CLOption)clOptions2.get( 0 ) ).getId(), 0 );
  -        assertEquals( ( (CLOption)clOptions2.get( 1 ) ).getId(), ALL_OPT );
  -        assertEquals( ( (CLOption)clOptions2.get( 2 ) ).getId(), CLEAR1_OPT );
  -        assertEquals( ( (CLOption)clOptions2.get( 3 ) ).getId(), CLEAR2_OPT );
  -        assertEquals( ( (CLOption)clOptions2.get( 4 ) ).getId(), CLEAR3_OPT );
  -        assertEquals( ( (CLOption)clOptions2.get( 5 ) ).getId(), CLEAR5_OPT );
  -        assertEquals( ( (CLOption)clOptions2.get( 6 ) ).getId(), 0 );
  +        assertEquals( ( (CLOption)clOptions2.get( 0 ) ).getDescriptor().getId(), 0 );
  +        assertEquals( ( (CLOption)clOptions2.get( 1 ) ).getDescriptor().getId(), ALL_OPT
);
  +        assertEquals( ( (CLOption)clOptions2.get( 2 ) ).getDescriptor().getId(), CLEAR1_OPT
);
  +        assertEquals( ( (CLOption)clOptions2.get( 3 ) ).getDescriptor().getId(), CLEAR2_OPT
);
  +        assertEquals( ( (CLOption)clOptions2.get( 4 ) ).getDescriptor().getId(), CLEAR3_OPT
);
  +        assertEquals( ( (CLOption)clOptions2.get( 5 ) ).getDescriptor().getId(), CLEAR5_OPT
);
  +        assertEquals( ( (CLOption)clOptions2.get( 6 ) ).getDescriptor().getId(), 0 );
       }
   
       public void test2PartPartialParse()
  @@ -459,10 +460,10 @@
           final int size1 = clOptions1.size();
   
           assertEquals( size1, 4 );
  -        assertEquals( ( (CLOption)clOptions1.get( 0 ) ).getId(), YOU_OPT );
  -        assertEquals( ( (CLOption)clOptions1.get( 1 ) ).getId(), 0 );
  -        assertEquals( ( (CLOption)clOptions1.get( 2 ) ).getId(), ALL_OPT );
  -        assertEquals( ( (CLOption)clOptions1.get( 3 ) ).getId(), CLEAR1_OPT );
  +        assertEquals( ( (CLOption)clOptions1.get( 0 ) ).getDescriptor().getId(), YOU_OPT
);
  +        assertEquals( ( (CLOption)clOptions1.get( 1 ) ).getDescriptor().getId(), 0 );
  +        assertEquals( ( (CLOption)clOptions1.get( 2 ) ).getDescriptor().getId(), ALL_OPT
);
  +        assertEquals( ( (CLOption)clOptions1.get( 3 ) ).getDescriptor().getId(), CLEAR1_OPT
);
   
           assertTrue( parser1.getUnparsedArgs()[ 0 ].equals( "ler" ) );
   
  @@ -475,8 +476,8 @@
           final int size2 = clOptions2.size();
   
           assertEquals( size2, 2 );
  -        assertEquals( ( (CLOption)clOptions2.get( 0 ) ).getId(), 0 );
  -        assertEquals( ( (CLOption)clOptions2.get( 1 ) ).getId(), 0 );
  +        assertEquals( ( (CLOption)clOptions2.get( 0 ) ).getDescriptor().getId(), 0 );
  +        assertEquals( ( (CLOption)clOptions2.get( 1 ) ).getDescriptor().getId(), 0 );
       }
   
       public void testDuplicatesFail()
  @@ -508,7 +509,7 @@
   
           assertEquals( size, 1 );
           final CLOption option = (CLOption)clOptions.get( 0 );
  -        assertEquals( option.getId(), DEFINE_OPT );
  +        assertEquals( option.getDescriptor().getId(), DEFINE_OPT );
           assertEquals( option.getArgument( 0 ), "stupid" );
           assertEquals( option.getArgument( 1 ), "" );
       }
  @@ -531,9 +532,9 @@
           final int size = clOptions.size();
   
           assertEquals( size, 2 );
  -        assertEquals( ( (CLOption)clOptions.get( 1 ) ).getId(), CLEAR1_OPT );
  +        assertEquals( ( (CLOption)clOptions.get( 1 ) ).getDescriptor().getId(), CLEAR1_OPT
);
           final CLOption option = (CLOption)clOptions.get( 0 );
  -        assertEquals( option.getId(), DEFINE_OPT );
  +        assertEquals( option.getDescriptor().getId(), DEFINE_OPT );
           assertEquals( option.getArgument( 0 ), "stupid" );
           assertEquals( option.getArgument( 1 ), "" );
       }
  @@ -556,9 +557,9 @@
           final int size = clOptions.size();
   
           assertEquals( size, 2 );
  -        assertEquals( ( (CLOption)clOptions.get( 1 ) ).getId(), CLEAR1_OPT );
  +        assertEquals( ( (CLOption)clOptions.get( 1 ) ).getDescriptor().getId(), CLEAR1_OPT
);
           final CLOption option = (CLOption)clOptions.get( 0 );
  -        assertEquals( option.getId(), DEFINE_OPT );
  +        assertEquals( option.getDescriptor().getId(), DEFINE_OPT );
           assertEquals( option.getArgument( 0 ), "stupid" );
           assertEquals( option.getArgument( 1 ), "" );
       }
  @@ -574,11 +575,11 @@
   
           CLOption optionById = parser.getArgumentById( FILE_OPT );
           assertNotNull( optionById );
  -        assertEquals( FILE_OPT, optionById.getId() );
  +        assertEquals( FILE_OPT, optionById.getDescriptor().getId() );
   
           CLOption optionByName = parser.getArgumentByName( FILE.getName() );
           assertNotNull( optionByName );
  -        assertEquals( FILE_OPT, optionByName.getId() );
  +        assertEquals( FILE_OPT, optionByName.getDescriptor().getId() );
       }
   
       /**
  @@ -598,7 +599,7 @@
   
           final CLOption optionByID = parser.getArgumentById( 'n' );
           assertNotNull( optionByID );
  -        assertEquals( 'n', optionByID.getId() );
  +        assertEquals( 'n', optionByID.getDescriptor().getId() );
   
           final CLOption optionByName = parser.getArgumentByName( FILE.getName() );
           assertNull( "Looking for non-existent option by name", optionByName );
  @@ -621,7 +622,7 @@
   
           final CLOption optionByID = parser.getArgumentById( 'n' );
           assertNotNull( optionByID );
  -        assertEquals( 'n', optionByID.getId() );
  +        assertEquals( 'n', optionByID.getDescriptor().getId() );
   
           final StringBuffer sb = CLUtil.describeOptions( options );
           final String lineSeparator = System.getProperty( "line.separator" );
  
  
  
  1.23      +10 -10    avalon-excalibur/cli/src/java/org/apache/avalon/excalibur/cli/CLArgsParser.java
  
  Index: CLArgsParser.java
  ===================================================================
  RCS file: /home/cvs/avalon-excalibur/cli/src/java/org/apache/avalon/excalibur/cli/CLArgsParser.java,v
  retrieving revision 1.22
  retrieving revision 1.23
  diff -u -r1.22 -r1.23
  --- CLArgsParser.java	19 Jan 2003 14:13:15 -0000	1.22
  +++ CLArgsParser.java	27 Feb 2003 14:38:05 -0000	1.23
  @@ -250,7 +250,7 @@
           for( int i = 0; i < size; i++ )
           {
               final CLOption option = (CLOption)arguments.elementAt( i );
  -            final int id = option.getId();
  +            final int id = option.getDescriptor().getId();
               final CLOptionDescriptor descriptor = getDescriptorFor( id );
   
               //this occurs when id == 0 and user has not supplied a descriptor
  @@ -281,14 +281,14 @@
               }
   
               final CLOption option = (CLOption)arguments.elementAt( i );
  -            final int id = option.getId();
  +            final int id = option.getDescriptor().getId();
   
               for( int j = 0; j < incompatible.length; j++ )
               {
                   if( id == incompatible[ j ] )
                   {
                       final CLOption originalOption = (CLOption)arguments.elementAt( original
);
  -                    final int originalId = originalOption.getId();
  +                    final int originalId = originalOption.getDescriptor().getId();
   
                       String message = null;
   
  @@ -462,7 +462,7 @@
               }
               else if( STATE_REQUIRE_ARG == m_state )
               {
  -                final CLOptionDescriptor descriptor = getDescriptorFor( m_option.getId()
);
  +                final CLOptionDescriptor descriptor = getDescriptorFor( m_option.getDescriptor().getId()
);
                   final String message =
                       "Missing argument to option " + getOptionDescription( descriptor );
                   throw new ParseException( message, 0 );
  @@ -476,7 +476,7 @@
                   }
                   else
                   {
  -                    final CLOptionDescriptor descriptor = getDescriptorFor( m_option.getId()
);
  +                    final CLOptionDescriptor descriptor = getDescriptorFor( m_option.getDescriptor().getId()
);
                       final String message =
                           "Missing argument to option " + getOptionDescription( descriptor
);
                       throw new ParseException( message, 0 );
  @@ -588,7 +588,7 @@
       private final void addOption( final CLOption option )
       {
           m_options.addElement( option );
  -        m_lastOptionId = option.getId();
  +        m_lastOptionId = option.getDescriptor().getId();
           m_option = null;
       }
   
  @@ -669,7 +669,7 @@
   
                   if( TOKEN_SEPARATOR == token.getType() )
                   {
  -                    final CLOptionDescriptor descriptor = getDescriptorFor( m_option.getId()
);
  +                    final CLOptionDescriptor descriptor = getDescriptorFor( m_option.getDescriptor().getId()
);
                       final String message =
                           "Unable to parse first argument for option " +
                           getOptionDescription( descriptor );
  @@ -774,9 +774,9 @@
           {
               final CLOption option = (CLOption)m_options.get( i );
               final CLOptionDescriptor optionDescriptor =
  -                getDescriptorFor( option.getId() );
  +                getDescriptorFor( option.getDescriptor().getId() );
   
  -            m_optionIndex.put( new Integer( option.getId() ), option );
  +            m_optionIndex.put( new Integer( option.getDescriptor().getId() ), option );
   
               if( null != optionDescriptor &&
                   null != optionDescriptor.getName() )
  
  
  
  1.3       +1 -1      avalon-excalibur/cli/examples/no_aliasing/NoAlias.java
  
  Index: NoAlias.java
  ===================================================================
  RCS file: /home/cvs/avalon-excalibur/cli/examples/no_aliasing/NoAlias.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- NoAlias.java	25 Feb 2003 16:28:43 -0000	1.2
  +++ NoAlias.java	27 Feb 2003 14:38:05 -0000	1.3
  @@ -63,7 +63,7 @@
           {
               final CLOption option = (CLOption)options.get( i );
   
  -            switch( option.getId() )
  +            switch( option.getDescriptor().getId() )
               {
                   case CLOption.TEXT_ARGUMENT:
                       //This occurs when a user supplies an argument that
  
  
  
  1.3       +1 -1      avalon-excalibur/cli/examples/incompat_options/IncompatOptions.java
  
  Index: IncompatOptions.java
  ===================================================================
  RCS file: /home/cvs/avalon-excalibur/cli/examples/incompat_options/IncompatOptions.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- IncompatOptions.java	25 Feb 2003 16:28:37 -0000	1.2
  +++ IncompatOptions.java	27 Feb 2003 14:38:05 -0000	1.3
  @@ -74,7 +74,7 @@
           {
               final CLOption option = (CLOption)options.get( i );
   
  -            switch( option.getId() )
  +            switch( option.getDescriptor().getId() )
               {
                   case CLOption.TEXT_ARGUMENT:
                       //This occurs when a user supplies an argument that
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: cvs-unsubscribe@avalon.apache.org
For additional commands, e-mail: cvs-help@avalon.apache.org


Mime
View raw message