Code Monkey home page Code Monkey logo

cli3's Introduction

CLI3 - Command Line Interface 3

For a long time, I am looking for good and popular command line parser to ease command line tool developments in Java. However, none satisfied me.

Apache Commons CLI is simple, elegant, and popular. But it is too limited that do not support common design such as sub-command. And its successor, CLI2, is never finished nor released according to official website. Since I do not know any other good and popular implementation (any suggestion?), I decide to make my own one.

Ideas

Here are some thoughts about how CLI3 should be designed:

  • Should be able to integrate with Apache Commons Configuration or any other configuration framework.

    Since command line will change program behavior, it should be considered part of the configuration system, too. For example, the Boost C++ Program Options library demonstrates how the configuration system and command line processing could be integrated together well.

    However, I would like to narrow the scope first. So, I am not planning to develop a huge framework that covers both configuration and command line processing. Integrating with existing configuration framework become a good alternative approach. After all, configuration is much complex than command line processing.

  • Should promote good command line interface design.

    There could be many guidelines, and exceptions. I will just list a few here and describe in detail in later section:

    • xargs(1) friendly
    • consistent positional argument order
    • support common pattens, such as sub-command
    • consistent behavior/direction between arguments and standard in/out.
    • ...

    I believe there are many materials on Internet, too. However, although I will search for these existing, popular, and recommended command line interface design patterns, I may not adopt everything. Instead, I would like to verify these guidelines based on my preferences. After all, this is my framework and I may use it in many places.

    How the Java framework be design to promote good design may be hard. That may become the major bottleneck of development of this framework.

  • Prefer declarable over programmable.

    The specification of command line interface should be declared instead of programmed. It would be good if the declarations in code look like common man page layout. This is hard to design, too. I know.

  • Can automatically generate usage lines, help description, and man page synopsis and option lists.

    This may need to integrate with the configuration framework. Since the command line options and arguments should share the same semantic and description with configuration framework.

    The command line interface may have to follow configuration framework. Because the behaviors that command line interface can control, is usually a sub set of full configurable option set.

  • Is extensible by adaptive program components, to allow compositioin of features now and the future.

(TBD)

cli3's People

Contributors

jeffhung avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Forkers

strategist922

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.