Closed buzden closed 2 months ago
Also I propose to clean up types a little bit. Unlike rlwrap arguments, there is no need to distinguish between not set extra arguments and empty list of extra arguments, so there is no need to have a type isomorphic to Maybe CmdArgList
, so let's clean code up and remove unneeded equivalent state representation. I made this a separate commit to (hopefully) make review easier.
Pinging @0xd34df00d as the original option's author. What do you think of the order change?
PR #270 introduces
--extra-args
option enabling us to pass additional arguments to the compiler. But this options works in an unexpected way sometimes: e.g.build
,cleanbuild
and, I think,install
;pack.toml
s are stacked together, but only the last CLI option is taken into account.What I propose is to pass extra-args to each call to the compiler (except for the very special internal calls of
pack
to the compiler usingidrisExec
function directly) so that any current and future command would respect this option. Also, I propose to take all passed extra arguments into account.The only change that I made and I'm not certain about is the order: currently for the REPL options, where now
--extra-args
are used, those options are in the right ofpack
's own options, while I made them to be on the left. I personally think this is, actually, good, since we don't want user extra options to fiddle or override options that are important topack
itself. But this behaviour may break current behaviour is case of existing abuse of--extra-args
option.