-
Notifications
You must be signed in to change notification settings - Fork 73
Closed as not planned
Description
Description
Would like a way to throw ArguParseException, either directly or indirectly via a helper.
e.g. missingArg or invalidCommand of string -> 'a that would raise (ArguParseException("ERROR: " + message)) or similar
Expected behavior
Can handle 2% of cases where I determine that semantics have been contravened by the invocation, but can't represent that rule via attributes and/or Argu API calls
Actual behavior
Need to define my own exception for that, and then remember to handle it explicitly as I already need to for ArguParseException
Known workarounds
In Equinox, Propulsion and some closed source apps, I and others have established a convention of having a secondary exception (MissingArg)
- example codebase: https://github.com/jet/propulsion/search?q=MissingArg
- most ugly bit is https://github.com/jet/propulsion/blob/2bbe428cdb99e229d7f21c3ac389b73bbb64a822/tools/Propulsion.Tool/Program.fs#L282
- but having to provide handling such as https://github.com/jet/propulsion/blob/2bbe428cdb99e229d7f21c3ac389b73bbb64a822/tools/Propulsion.Tool/Program.fs#L285 is also not ideal
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels