leancodepl / contractsgenerator-dart

Dart contracts client generator for a CQRS API
3 stars 1 forks source link

Add possibility of specifying config file through the CLI #81

Open shilangyu opened 1 year ago

shilangyu commented 1 year ago

Problem

Currently the config file name (and path) is hardcoded for the CLI. This means that a user can only use a single config file in a given project. While the config file allows for gathering contracts from different sources, it still outputs everything to a single file. There are use cases where one would prefer to output contracts into two separate files.

Proposed solution

Introduce a new CLI flag (both for the generation and init subcommands), --config which will point to a place where the config file is/should be located. The currently hardcoded config file path should be the default value for this flag.

This way, one can have multiple config files and just point to them when generating different contracts.