Now that slicec is a binary which runs plugins vs a library used for other compilers, we need to augment it's CLI.
This is an example of the current proposal:
slicec \
--generator /path/to/icerpc-gen.bat \
--generator /path/to/zeroc-gen.bat \
--output-dir ~/code \
Test1.slice Test2.slice ...
It would also support the usual -- to distinguish between the Slice file inputs vs the command-line options.
There are no names to the generators (unlike protoc which uses go_out=...), and there is a single output-dir option, shared by all generators. The thinking is that it's going to be most common than you'll be compiling for a single language at a time, and want all of you generated code in the same place.
It'd be tedious to specify the same output directory for both your .cs and IceRpc.cs files.
If you want your generated code to end up in multiple output directories, you need to call slicec multiple times.
This isn't going to be relevant for us anytime soon, but we also support passing arbitrary options to each generator with the syntax:
--generator /my/generator.exe;key1=value1;key2=value2
Also, of course, we'll want to support quoted things too, and escaping for ;, =, and ".
--generator "/my/generator.exe;key1=value1;key2=value2"
We'd support -G as a shorthand for --generator and -O as a shorthand for --output-dir.
Note that slicec already has a handful of command-line options, which don't conflict with this proposal.
-D to define preprocessor symbols, -R for reference files, --dry-run to run but not generate code etc.
Now that
slicecis a binary which runs plugins vs a library used for other compilers, we need to augment it's CLI.This is an example of the current proposal:
It would also support the usual
--to distinguish between the Slice file inputs vs the command-line options.There are no names to the generators (unlike protoc which uses
go_out=...), and there is a single output-dir option, shared by all generators. The thinking is that it's going to be most common than you'll be compiling for a single language at a time, and want all of you generated code in the same place.It'd be tedious to specify the same output directory for both your
.csandIceRpc.csfiles.If you want your generated code to end up in multiple output directories, you need to call
slicecmultiple times.This isn't going to be relevant for us anytime soon, but we also support passing arbitrary options to each generator with the syntax:
Also, of course, we'll want to support quoted things too, and escaping for
;,=, and".We'd support
-Gas a shorthand for--generatorand-Oas a shorthand for--output-dir.Note that
slicecalready has a handful of command-line options, which don't conflict with this proposal.-Dto define preprocessor symbols,-Rfor reference files,--dry-runto run but not generate code etc.