HomeFreeBSD

rs: Use getopt() and strtol() instead of mannual parsing.

Description

rs: Use getopt() and strtol() instead of mannual parsing.

This uses the "::" extension to getopt() to handle options which take
an optional argument.

The updated flag tests were all wrong before and only passed because
the manual parser failed to raise errors when a required argument was
missing. The invalid argument test now gets a better error message.

Reviewed by: brooks, imp, emaste
Differential Revision: https://reviews.freebsd.org/D36834

Details

Provenance
jhbAuthored on Nov 16 2022, 5:19 AM
Reviewer
brooks
Differential Revision
D36834: rs: Use getopt() and strtol() instead of mannual parsing.
Parents
rG838a06141730: depend-cleanup.sh: Handle rs(1) moving to C++.
Branches
Unknown
Tags
Unknown