AptLynx

Command-line tool

gnu-getopt

brew/gnu-getopt

Checked 25 Oct 2026, 21:09 UTC · Listing refreshed from Homebrew, winget, npm, Scoop and cargo; npm packages checked against OSV.dev

Command-line option parsing utility

At a glance

Type
Command-line tool
Install on
Windows, macOS, Linux
Last checked
25 Oct 2026, 21:09 UTC

Install it

Windows

cargo install getopt

macOS

brew install gnu-getopt
cargo install getopt

Linux

brew install gnu-getopt
cargo install getopt

Parse optional `verbose`/`version` flags with shorthands

getopt -o vV -l verbose,version -- --version --verbose

Add a `--file` option with a required argument with shorthand `-f`

getopt -o f: -l file: -- --file=somefile

Add a `--verbose` option with an optional argument with shorthand `-v`, and pass a non-option parameter `arg`

getopt -o v:: -l verbose:: -- --verbose arg

Related command-line tools

Listing text is written by the maker; AptLynx lists tools and does not vouch for them. Find another tool · Browse by topic · For agents