GaloisInc / daedalus

The Daedalus data description language
BSD 3-Clause "New" or "Revised" License
65 stars 11 forks source link

daedalus: make Options carry an optional optParserDDL #299

Closed jtdaugherty closed 1 year ago

jtdaugherty commented 1 year ago

This change makes it so that rather than using an empty string to indicate "no optParserDDL value", we use Nothing. This forces the uses of optParserDDL to deal better with the case where the argument is missing; previously, an invalid command like 'daedalus run' would emit this error:

  Missing module ``
  Searched paths:
    * ./

That error obscures the basic problem, which is that the implementation expected a DDL file argument after 'run'. This change makes it so that when the filename is missing, a GetOptException is raised instead, which ought to be consistent with a few other places where late-stage input errors are handled in a similar way.