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
018package 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 * @version $Id: BasicParser.java 1443102 2013-02-06 18:12:16Z tn $
025 * @deprecated since 1.3, use the {@link DefaultParser} instead
026 */
027@Deprecated
028public class BasicParser extends Parser
029{
030    /**
031     * <p>A simple implementation of {@link Parser}'s abstract
032     * {@link Parser#flatten(Options, String[], boolean) flatten} method.</p>
033     *
034     * <p><b>Note:</b> <code>options</code> and <code>stopAtNonOption</code>
035     * are not used in this <code>flatten</code> method.</p>
036     *
037     * @param options The command line {@link Options}
038     * @param arguments The command line arguments to be parsed
039     * @param stopAtNonOption Specifies whether to stop flattening
040     * when an non option is found.
041     * @return The <code>arguments</code> String array.
042     */
043    @Override
044    protected String[] flatten(@SuppressWarnings("unused") Options options,
045            String[] arguments,
046            @SuppressWarnings("unused") boolean stopAtNonOption)
047    {
048        // just echo the arguments
049        return arguments;
050    }
051}