Drizin/CodegenCS

Create my own CLI with Codegencs

Closed this issue · 2 comments

There is not a way to pass in runtime variables. There should be a way to pass in variables during runtime and not just using a static file. I want the user to pass in that information. How is this done with this tool?

I figured out how to do it. I just made an temp json file and call the dotnet tool directly

There are many options:

  • You can pass variables using an IInputModel in JSON format (I think that's what you did).
  • You can inject CommandLineArgs and process the array of strings on your own
  • You can inject any class that implements IAutoBindCommandLineArgs so this class is automatically loaded from the arguments, and optionally you can also create a ConfigureCommand method that can describe arguments, options, default values, and their descriptions (dotnet-codegencs can show those cli options).