All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.apache.ode.utils.cli.CommandlineFragment Maven / Gradle / Ivy

There is a newer version: 1.3.8
Show newest version
/*
 * 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.  See the License for the
 * specific language governing permissions and limitations
 * under the License.
 */
package org.apache.ode.utils.cli;

import java.util.List;

/**
 * 

* Basic interface for a fragment of a commandline; that fragment could be a single * flag, could be a flag with one or more arguments, or could be an argument. *

*/ public interface CommandlineFragment { /** * The prefix ("-") that signifies that an argument is a flag. */ public static String COMMAND_PREFIX = "-"; /** *

* Reset the fragment to its initial state. This is useful for reusing fragments * in multiple commandline structures. *

*/ public void reset(); /** *

* Grab the pieces of the commandline relevant to this argument, configure the * implementation, and then return a new array of arguments that will have the * pieces of the original commandline that this command used removed. *

* @param s the list of arguments * @return the list of arguments, post parse * @throws CommandlineSyntaxException if the commandline is structurally invalid. */ public List consume(List s) throws CommandlineSyntaxException; /** *

* Construct a usage string for this commandline fragment. The usage string is * used when constructing a strawman commandline example and when formatting help. *

* @return the usage string */ public String getUsage(); /** *

* Return a description of this commandline fragment. The description should be a * (short) narrative item that describes the purpose of the fragment. It is only * used when formatting help. *

* @return the description */ public String getDescription(); /** * @return true if this fragment is optional. */ public boolean isOptional(); }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy