getopt Command Examples

Parse command-line arguments. More information: https://www.gnu.org/software/libc/manual/html_node/Getopt.html.

getopt --options vV --longoptions verbose,version -- --version --verbose

getopt --options f: --longoptions file: -- --file=somefile

getopt --options v:: --longoptions verbose:: -- --verbose arg

getopt --options rv::s::t: --longoptions verbose,source::,target: -- -v --target target