The command-line parser library based on Python's argparse, providing argument parsing for Java applications.
Install & Compatibility
Where this runs
No compatibility data collected yet for this library.
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
net.sourceforge.argparse4j.ArgumentParsers
Parses command-line arguments with a simple name option.
import net.sourceforge.argparse4j.ArgumentParsers;
import net.sourceforge.argparse4j.inf.ArgumentParser;
import net.sourceforge.argparse4j.inf.Namespace;
public class Main {
public static void main(String[] args) {
ArgumentParser parser = ArgumentParsers.newFor("myapp").build()
.defaultHelp(true)
.description("Example app");
parser.addArgument("-n", "--name").setDefault("World");
Namespace ns = parser.parseArgsOrFail(args);
System.out.println("Hello, " + ns.getString("name"));
}
}
Debug
Known footguns
No known footguns recorded.
Upgrade
Version history
Breaking-change detection hasn't run for this library yet.
Audit
Security & dependencies
CVE tracking and dependency tree are planned for a later release.
Agent activity
0 hits · last 30 days
No traffic data recorded yet.