Skip to content

Koettlitz/clp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This project contains an argumentparser for command line arguments.

An instance of the ArgumentParser class can parse command line arguments into an ArgumentModel object, which contains all the information from the given arguments. To create an instance of an ArgumentParser, the ArgumentParserBuilder class provides methods to specify what type of command line arguments the program expects:

    ArgumentParser parser = ArgumentParserBuilder.begin()
                                                 .addArgument("foo")
                                                 .buildArgument("bar")
                                                     .setMandatory(false)
                                                     .setDescription("description of bar")
                                                     .build()
                                                 .buildOption('b', "bar")
                                                     .setDescription("description of option bar")
                                                     .setExpectsValue(true)
                                                     .build()
                                                 .buildAndGet();
    
    ArgumentModel result = parser.parseArguments("-b", "bValue", "fooValue");

About

A java command line parser

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages