Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The argument parsing of actonc has now been changed to support the
concept of commands.
We used to take a single mandatory argument, which was expected to be a
file path. If the file ended with .act, we would compile it whereas if
it was a .ty file we would dump its content. E.g. valid use cases:
actonc foo.act
actonc foo.ty
We now take a single mandatory argument, which is expected to be a
command. As a shortcut, we do still support being passed a .act file and
will then compile it, which means we are also somewhat backwards
compatible. For example:
actonc foo.act
Dumping the content of a file is however not supported by just sending
in a file path as the only argument. There is a new command, aptly named
"dump" which in turn accepts an option --file for the filename of the
.ty file to dump. For example
actonc dump --file foo.ty
There's also a build command, but it's not yet implemented:
actonc build
The idea is that it should build an entire Acton project.
I noticed, after implementing this, that Options.Applicative that we use
for argument parsing has support for something it calls "commands",
which is probably something we want to use. I assume it will give us
arguments that are per command rather than as now, where arguments are
global and could potentially mean different thing for different
commands.
Part of #594.