- Jakarta Commons CLI
- コマンドライン引数をパースしてという CLI(Command Line Interface)
- Options: 受け取れるオプション
- addOption で受け取れる引数を追加していく
- parser.parse(options, args)とするとパースした結果を得られる
import org.apache.commons.cli.base.*;
final Options options = new Options();
final Option helpOpt = OptionBuilder
.hasArg(false)
.withArgName("help")
.isRequired(false)
.withDescription("このヘルプ")
.withLongOpt("help")
.create(HELP_OPT);
options.addOption(helpOpt);
final CommandLineParser parser = new BasicParser();
final CommandLine commandLine = null;
try {
commandLine = parser.parse(options, args);
} catch (ParseException e) {
new HelpFormatter().printHelp("homura help", options)
System.exit(1);
}
Pinned Articles
About
ウェブ界隈でエンジニアとして労働活動に励んでいる @gomi_ningen 個人のブログです
Tags
LLM
promptfoo
GenAI
JavaScript
PowerShell
fluentd
kibana
elasticsearch
nginx
村川梨衣
五十嵐裕美
イベント
logrotate
IoT
Scala
Java
ICMP
iputils
C言語
WUG
mastodon
Swift
AWS
Windows
Clock
PoEAA
アーキテクチャ
iOS
DeviceFarm
プログラミング言語
OS
StepFunctions
Lambda
Serverless
terraform
ポエム
RHEL
ネットワーク
GraphQL
CloudWatch
Linux
Coreutils
nc
network
telnet
LinuxKernel
fpinscala
ELB
IAM
AppSync