![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
com.zkejid.constructor:cli-arguments
Advanced tools
Project handles command line arguments. It helps working with values passed in.
Constructor part for handling command line arguments.
You can register two types of arguments: flags and properties. Flags are single
letter arguments which represent boolean value. If given flag exists in an argument line, then
it has value of true
. If it does not exist, then it has value of false
. Flags can be
merged in one line argument. Here is the call to ls
utility with two flags -
-a
and -l
- merged together:
ls -al
Properties are name-value pairs, that user can specify in an argument line:
ls --tabsize=4
Command line can contain more arguments, than you registered. Parser would leave these arguments
unparsed. We will refer to these arguments as plain arguments. You can force parser to treat
the rest of command line as plain arguments if place --
argument. All arguments to the right
from this argument wold be plain.
To use the API you should request ArgumentsFactory.class
interface in your
ConstructorPart
implementation:
@Override
public Set<Class<?>> getInterfacesNecessary() {
return Set.of(ArgumentsFactory.class);
}
ArgumentsFactory
allows you to create an instance of the parser:
final ArgumentsParser parser = argumentsFactory.createParser();
Parser holds the configuration of arguments given instance of parser could parse. You can create as many instances of parser as you wish and configure them separately.
You can create a flag with expression:
Argument all = parser.addFlag("a", "all");
You can create a property with expression:
Argument tabSize = parser.addProperty("T", "tabsize");
The Argument
object serves as key for retrieval of value:
ParseResult parseResult = parser.parse(strings);
final StringValue allValue = parseResult.getArgumentsParsed().get(all);
if (allValue.getInputValueType() == InputValueType.SPECIFIED) {
// handle --all
}
You can find an example of application built around the module in cli-arguemnts-helloworld
artifact.
CliArguments is the module of Constructor Framework. You can simply place artifacts of this module on the path of application to use its API.
Module API has set of tests. You can use cli-arguments-apitest
artifact to test your
own implementation of API. Artifact contains set of *CheckList
files. These files are
abstract JUnit5 test classes. You should extend the class ans provide your implementation
through the abstract method.
Artifact versions of the CliArguments Module follow the Semantic Versioning 2.0.0 specification.
The module is provided under MIT License Copyright (c) 2020 Zkejid.
FAQs
Project handles command line arguments. It helps working with values passed in.
We found that com.zkejid.constructor:cli-arguments demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.