Skip to content

Consider merging GNU and POSIX templates and use getopt/getopts based on availability #4

@wwerner

Description

@wwerner

Using this pattern, we can detect whether GNU getopt is available and use it:

getopt -T > /dev/null
if [ $? -eq 4 ]; then
    # GNU enhanced getopt is available
    set -- `getopt --long help,output:,version --options ho:v -- "$@"`
else
    # Original getopt is available
    set -- `getopt ho:v "$@"`
fi

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions