MysteryBlokHed / databind

Expand the functionality of Minecraft Datapacks.
https://databind.rtfd.io/en/stable
GNU General Public License v3.0
4 stars 0 forks source link

Config file #1

Closed MysteryBlokHed closed 3 years ago

MysteryBlokHed commented 3 years ago

Add support for a TOML configuration file that lets you configure what/how Databind transpiles.

It should look something like this:

databind.toml

random_var_names = false
var_display_names = false
# Whether to auto-generate function JSON in minecraft/tags/functions
generate_func_json = true
# Functions not to generate JSON for
func_json_exclusions = [
    "main",
    "loop1"
]

Any values that aren't lists should also be passable as CLI arguments. An optional --config/-c argument should be added to specify the location of a config file. If the argument is not passed, Databind should look for a config file in the directory it's being run in. Otherwise, use default settings.

MysteryBlokHed commented 3 years ago

CLI argument should take priority over config file settings. So if --random-var-names was passed but random_var_names = false in the config, then random_var_names should be true.