I think the "--dry-run" parameter is unnecessary. It makes no sense to return a list of macros after building; usually they are needed before, or instead of, building. Moreover, during building, the output will contain compilation results, which will be difficult to distinguish from the returned text with macros.
In addition, with the second parameter it will be
too long:
lazbuild project1.lpi --expand-macros="text with macros"
# or
lazbuild project1.lpi --action=expand-macros --text="text with macros"
Along with the name of the
utility,
project and the
text itself, you need to write "
--action=expand-macros --text=". This is
very long. Look at the
FPC arguments - most of them are only one or two letters long!
Martin, I don't understand your concerns. Even if the user waits for the build when specifying this parameter, nothing bad will happen. He will see the text in the output (with macros expanded) and understand that the build did not occur.
In addition, the user will only learn about this command from the help, and there it will be
clearly written: "expand macros in the text instead of building."
By the way,
lazbuild already has 4 commands that cancel the build:
--help
--version
--create-makefile
--add-package-link
So introducing something like "
--dry-run" will only break the already existing format.
Look also at the arguments to "
gcc" or "
msbuild" - there is no division between "actions" and "arguments" anywhere. For example, the "
-c", "
-S" and "
-E" arguments to the "
gcc" compiler override the build (partially).
Any user must understand what the command he enters does.