mirage / functoria

A DSL to invoke otherworldly functors
ISC License
63 stars 21 forks source link

error handling -- "unknown option -t" #185

Open hannesm opened 4 years ago

hannesm commented 4 years ago

since functoria3 (/cc @samoht) the errors generated are more complex than needed.

Given a config.ml with a typo, I see the following output:

# mirage configure -t hvt
File "config.ml", line 46, characters 57-67:
46 |   Key.abstract name ; Key.abstract syslog ; Key.abstract monitoring ;
                                                              ^^^^^^^^^^
Error: Unbound value monitoring
Hint: Did you mean monitor?
mirage: unknown option `-t'.
Usage: mirage configure [OPTION]... 
Try `mirage configure --help' or `mirage --help' for more information.
run ['dune' 'exec' '--root'
     '/usr/home/hannes/devel/mirage/unikernels/lets-encrypt' '--'
     './config.exe' 'configure' '-t' 'hvt']: exited with 1

It would be great if we could avoid the "unknown option '-t'" message, which is misleading.