LoginSignup
0
0

More than 3 years have passed since last update.

args4j defaultを表示させない方法

Last updated at Posted at 2019-11-28

概要

先日args4jを使っていて、以下のような現象に悩まされました。
defaultの部分が自動生成される。

-h (--help)    : print usage message and exit (default: true)
-v (--version) : print version (default: false)

解決策

API仕様を見たところ、withShowDefaultsというメソッドがデフォルトでtrueを返しているようなので、falseを渡してあげます。

ParserProperties parserProps = ParserProperties.defaults().withShowDefaults(false);
-h (--help)    : print usage message and exit 
-v (--version) : print version 

defaultが表示されないようになりました。

参考

API仕様
https://args4j.kohsuke.org/args4j/apidocs/org/kohsuke/args4j/ParserProperties.html

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0