Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compilation terminates whith unknown flags. #379

Merged

Conversation

TheGrandmother
Copy link
Contributor

Compilation now fails when unknown flags are provided.
Ex:
encorec -blah test.enc
outputs
Unknown flag bla. Use -help to se avaliable flags.

A -help flag is available that outputs:

Welcome to the Encore compiler!
Usage: encorec [flags] file

Flags:
  -c           Keep intermediate C-files
  -tc          Typecheck only (don't produce an executable)
  -o [file]    Specify output file
  -run         Run the program and remove the executable
  -clang       Use clang to build the executable (default)
  -AST         Output the parsed AST as text to foo.AST
  -TypedAST    Output the typechecked AST as text to foo.TAST
  -nogc        Disables the garbage collection of passive objects.
  -help        Print this message and exit.
  -I p1:p2:... Directories in which to look for modules.

There is also a -help flag avaliable.
mapM (\flag -> case flag of
Undefined flag ->
abort $ "Unknown flag " <> flag <>
". Use -help to se avaliable flags."
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

se -> see

@EliasC
Copy link
Contributor

EliasC commented Apr 14, 2016

I like this! Happy to merge!

@EliasC EliasC merged commit e76e7dc into parapluu:development Apr 14, 2016
@TheGrandmother TheGrandmother deleted the features/crash-on-unknown-flag branch April 28, 2016 14:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants