easy-cli

Java library for easy command line argument parsing

License

License

MIT
Categories

Categories

CLI User Interface
GroupId

GroupId

com.github.pravejos
ArtifactId

ArtifactId

easy-cli
Last Version

Last Version

1.2.0
Release Date

Release Date

Type

Type

pom.sha512
Description

Description

easy-cli
Java library for easy command line argument parsing
Project URL

Project URL

https://github.com/pravejos/easy-cli
Source Code Management

Source Code Management

https://github.com/pravejos/easy-cli

Download easy-cli

Dependencies

There are no dependencies for this project. It is a standalone project that does not depend on any other jars.

Project Modules

There are no modules declared in this project.

Examples Maven Central GitHub license

Overview

easy-cli is a java library for easy command line argument parsing. It can also print help message which shows the options available for the command line tool.

It is annotation based, which makes it easier to define and use the parsed arguments.

Features:

  • Open source
  • Easy to use
  • Supports different types of options
    • Short and long options (e.g. ls -r and ls --reverse)
      • POSIX like options (e.g. ls -ltr Test.java)
      • GNU like long options (e.g. ls --reverse --format=commas)
    • With space separator between the option and value (e.g. --option value or -o value)
  • Generates help message

A sample help message displayed by the library is shown below

Usage: java [JavaOptions] <mainclass> [OPTIONS] [PARAMETERS]
   or  java [JavaOptions] -jar <jarfile> [OPTIONS] [PARAMETERS]

Options:
  -E, --extended-regexp PATTERNS are extended regular expressions (default "false")
  -F, --fixed-strings PATTERNS are strings (default "false")
  -e, --regexp        use PATTERNS for matching
  -f, --file          take PATTERNS from FILE
  -i, --ignore-case   ignore case distinctions in patterns and data (default "false")
  -m, --max-count     stop after NUM selected lines

Parameters:
  Param1 (Mandatory) contain multiple patterns separated by newlines
  Param2 File (1) to check the pattern (default ".")
  Param3 File (2) to check the pattern
  Param4 File (3) to check the pattern

Versions

Version
1.2.0
1.1.0
1.0.0