Page MenuHomeFreeBSD

mfh: Make argument parsing a bit more robust
ClosedPublic

Authored by 0mp on Aug 5 2020, 2:19 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Sep 5, 5:45 PM
Unknown Object (File)
Sat, Sep 5, 5:45 PM
Unknown Object (File)
Sat, Sep 5, 6:42 AM
Unknown Object (File)
Sat, Sep 5, 3:44 AM
Unknown Object (File)
Fri, Sep 4, 7:39 PM
Unknown Object (File)
Fri, Sep 4, 6:17 PM
Unknown Object (File)
Fri, Sep 4, 2:24 PM
Unknown Object (File)
Wed, Sep 2, 12:11 PM
Subscribers

Details

Reviewers
None
Group Reviewers
portmgr
Commits
rP544225: Make argument parsing a bit more robust
Summary
Make argument parsing a bit more robust

Currently, when running mfh with a flag like --help the user gets a confusing
error message from expr(1) like the following:

> expr: illegal option -- -
> expr: usage: expr [-e] expression
>
> revision "--help" should be a number

This is not helpful. Instead, make sure that any arguments specified by the
user are handled properly by expr(1). This results in a much cleaner error
message:

> revision "--help" should be a number

Diff Detail

Repository
rP FreeBSD ports repository
Lint
No Lint Coverage
Unit
No Test Coverage
Build Status
Buildable 32769
Build 30204: arc lint + arc unit

Event Timeline

0mp requested review of this revision.Aug 5 2020, 2:19 PM
This revision was not accepted when it landed; it landed in state Needs Review.Aug 5 2020, 3:03 PM
This revision was automatically updated to reflect the committed changes.