You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, the typing the following (mistyped) command:
idris2 --chec Test.idr
Will launch the repl saying it can't find the file --chec.
____ __ _ ___
/ _/___/ /____(_)____ |__ \
/ // __ / ___/ / ___/ __/ / Version 0.7.0-2bd88b7d3
_/ // /_/ / / / (__ ) / __/ https://www.idris-lang.org
/___/\__,_/_/ /_/____/ /____/ Type :? for help
Welcome to Idris 2. Enjoy yourself!
File error in --chec: File Not Found
Main>
This is pretty unusual behaviour, as most applications will error saying that --chec is not a valid flag. From a user perspective I would say its undesirable as they most likely made a typo and didn't want to start the REPL anyway. (I think there is another argument to be made that the REPL should not start if given non existent files in general).
The text was updated successfully, but these errors were encountered:
I've been thinking about this a bit and I feel like any robust solution will basically implement 90% of a generic command line arguments parser. I'm not sure how we feel about pulling in external libraries for the compiler (which might rely on getting the compiler packaged with a package manger like pack). To my knowledge there are two CLI libraries, collie and sap (my own library, so I'm probably biased).
The other thing I was going to suggest is that the CLI for Idris could be broken down into subcommands, something like:
The main advantage for this is that we can segregate flags into the different subcommands depending on where they are relevant. For example, a user checking a file does not need to know about the flags to set the compiler backend. This would simplify the help dialogues, and (in my opinion) provide a more intuitive interface. I'm not sure whether this is something that other people agree on? It would obviously break backwards compatibility for scripts using the interface.
Currently, the typing the following (mistyped) command:
Will launch the repl saying it can't find the file
--chec
.This is pretty unusual behaviour, as most applications will error saying that
--chec
is not a valid flag. From a user perspective I would say its undesirable as they most likely made a typo and didn't want to start the REPL anyway. (I think there is another argument to be made that the REPL should not start if given non existent files in general).The text was updated successfully, but these errors were encountered: