zoukankan      html  css  js  c++  java
  • Commons CLI 学习(1)

    The Apache Commons CLI library provides an API for parsing command line options passed to programs. It's also able to print help messages detailing the options available for a command line tool.

    Apache Commons CLI库提供了一批API,用来解析以命令行形式传递给程序的参数。同事,也可以用来打印 如何使用这些参数的help信息。

    Apache Commons CLI支持的类型有:

    • POSIX like options (ie. tar -zxvf foo.tar.gz)
    • GNU like long options (ie. du --human-readable --max-depth=1)
    • Java like properties (ie. java -Djava.awt.headless=true -Djava.net.useSystemProxies=true Foo)
    • Short options with value attached (ie. gcc -O2 foo.c)
    • long options with single hyphen (ie. ant -projecthelp)

    一个典型的Apache Commons CLI使用方式如下:

    usage: ls
     -A,--almost-all          do not list implied . and ..
     -a,--all                 do not hide entries starting with .
     -B,--ignore-backups      do not list implied entried ending with ~
     -b,--escape              print octal escapes for nongraphic characters
        --block-size <SIZE>   use SIZE-byte blocks
     -c                       with -lt: sort by, and show, ctime (time of last
                              modification of file status information) with
                              -l:show ctime and sort by name otherwise: sort
                              by ctime
     -C                       list entries by columns


  • 相关阅读:
    ElasticSearch学习记录
    用java代码手动控制kafkaconsumer偏移量
    kafka0.9.0及0.10.0配置属性
    kafka常用命令
    kafka消费者客户端(0.9.0.1API)
    kafka入门教程链接
    编程内功
    bzoj3145:[Feyat cup 1.5]Str
    3 SpringBoot与微服务
    2 微服务存在的问题和解决方案
  • 原文地址:https://www.cnblogs.com/aomi/p/8384068.html
Copyright © 2011-2022 走看看