    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      https://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 the {@link Parser#flatten(Options,String[],boolean)
    022 * flatten} method.
    023 *
    024 * @deprecated Since 1.3, use the {@link DefaultParser} instead.
    025 */
    026@Deprecated
    027public class BasicParser extends Parser {
    028
    029    /**
    030     * Constructs a new instance.
    031     */
    032    public BasicParser() {
    033        // empty
    034    }
    035
    036    /**
    037     * <p>
    038     * A simple implementation of {@link Parser}'s abstract {@link Parser#flatten(Options, String[], boolean) flatten}
    039     * method.
    040     * </p>
    041     *
    042     * <p>
    043     * <strong>Note:</strong> {@code options} and {@code stopAtNonOption} are not used in this {@code flatten} method.
    044     * </p>
    045     *
    046     * @param options The command line {@link Options}.
    047     * @param arguments The command line arguments to be parsed.
    048     * @param stopAtNonOption Specifies whether to stop flattening when an non option is found.
    049     * @return The {@code arguments} String array.
    050     */
    051    @Override
    052    protected String[] flatten(@SuppressWarnings("unused") final Options options, final String[] arguments,
    053            @SuppressWarnings("unused") final boolean stopAtNonOption) {
    054        // just echo the arguments
    055        return arguments;
    056    }
    057}