Giter Site home page Giter Site logo

mieubrisse / argparse4j Goto Github PK

View Code? Open in Web Editor NEW

This project forked from argparse4j/argparse4j

0.0 1.0 0.0 817 KB

Java port of Python's famous argparse command-line argument parser.

Home Page: https://argparse4j.github.io/

License: MIT License

Shell 0.03% Java 96.56% Makefile 0.91% CSS 0.28% HTML 0.11% Python 2.11%

argparse4j's Introduction

Argparse4j - The Java command-line argument parser library

https://travis-ci.org/argparse4j/argparse4j.svg?branch=master

Argparse4j is a command line argument parser library for Java based on Python's argparse module.

Argparse4j is available in Maven central repository:

<dependency>
  <groupId>net.sourceforge.argparse4j</groupId>
  <artifactId>argparse4j</artifactId>
  <version>0.8.1</version>
</dependency>

IMPORTANT: When upgrading from 0.4.4 or earlier version, read Migration. There is an important change in 0.5.0 which might break you code. The documentation describes the change and how to migrate from earlier versions.

There are still missing features which exist in argparse but not in argparse4j, but there are also new features which only exist in argparse4j.

Here is summary of features:

  • Supported positional arguments and named arguments.

  • Variable number of arguments.

  • Generates well formatted line-wrapped help message.

  • Suggests named arguments/sub-command if unrecognized arguments/sub-command were given, e.g.:

    unrecognized argument '--tpye'
    Did you mean:
      --type
  • Takes into account East Asian Width ambiguous characters when line-wrap.

  • Sub-commands like, git add.

  • Sub-command alias names, e.g., co for checkout.

  • Customizable option prefix characters, e.g. +f and /h.

  • Print default values in help message.

  • Choice from given collection of values.

  • Type conversion from option strings.

  • Can directly assign values into user defined classes using annotation.

  • Group arguments so that it will be printed in help message in more readable way.

  • Mutually exclusive argument group.

  • Read additional arguments from file.

  • Argument/sub-command abbreviations.

The primary documentation is done using Sphinx. You need Sphinx to run mvn site.

Upgrading to 0.5.0 or later versions

Please consult the documentation section for Migration.

argparse4j's People

Contributors

tatsuhiro-t avatar jstuyts avatar ssnikolaevich avatar grimreaper avatar cavorite avatar joerg-schoemer avatar lekkas avatar amr avatar dougclayton avatar jloomis avatar bergman avatar jon-ruckwood avatar marikaris avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.