001    /**
002     * Licensed to the Apache Software Foundation (ASF) under one or more
003     * contributor license agreements.  See the NOTICE file distributed with
004     * this work for additional information regarding copyright ownership.
005     * The ASF licenses this file to You under the Apache License, Version 2.0
006     * (the "License"); you may not use this file except in compliance with
007     * the License.  You may obtain a copy of the License at
008     *
009     *     http://www.apache.org/licenses/LICENSE-2.0
010     *
011     * Unless required by applicable law or agreed to in writing, software
012     * distributed under the License is distributed on an "AS IS" BASIS,
013     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014     * See the License for the specific language governing permissions and
015     * limitations under the License.
016     */
017    
018    package org.apache.commons.cli;
019    
020    /**
021     * The class BasicParser provides a very simple implementation of
022     * the {@link Parser#flatten(Options,String[],boolean) flatten} method.
023     *
024     * @author John Keyes (john at integralsource.com)
025     * @version $Revision: 680644 $, $Date: 2008-07-29 01:13:48 -0700 (Tue, 29 Jul 2008) $
026     */
027    public class BasicParser extends Parser
028    {
029        /**
030         * <p>A simple implementation of {@link Parser}'s abstract
031         * {@link Parser#flatten(Options, String[], boolean) flatten} method.</p>
032         *
033         * <p><b>Note:</b> <code>options</code> and <code>stopAtNonOption</code>
034         * are not used in this <code>flatten</code> method.</p>
035         *
036         * @param options The command line {@link Options}
037         * @param arguments The command line arguments to be parsed
038         * @param stopAtNonOption Specifies whether to stop flattening
039         * when an non option is found.
040         * @return The <code>arguments</code> String array.
041         */
042        protected String[] flatten(Options options, String[] arguments, boolean stopAtNonOption)
043        {
044            // just echo the arguments
045            return arguments;
046        }
047    }