nfdi4plants / ARCCommander

Tool to manage your ARCs
MIT License
11 stars 9 forks source link

First steps for including global and local settings #17

Closed HLWeil closed 3 years ago

HLWeil commented 3 years ago

@kMutagene maybe you have some other suggestions for where to put the command specific functions?

kMutagene commented 3 years ago

maybe you have some other suggestions for where to put the command specific functions?

take a look at these 3 readme files : API, Command, CLIArgs

HLWeil commented 3 years ago

take a look at these 3 readme files : API, Command, CLIArgs

So you mean the functions should be moved to the according API.fs file? To specify, I'm talking about functions which retrieve information from the configuration which are specific to a given command. e.g. a function which returns the investigation file name from the configuration.

kMutagene commented 3 years ago

Upon further investigation, i think you can apply the pattern used for API, CLIargs and Commands by adding a Configuration folder to the project and creating Configuration.fs files analogously to the other folders. These can then contain the functions that you put into your single Configuration.fs file.

So you mean the functions should be moved to the according API.fs file?

Depends on what you mean with 'according'. API.fs files should only contain the functions that are actually called by the command handling, so no, the study config stuff should not be put into StudyAPI.fs because that files contains the functions that are called by the study subcommand. I guess the best way is to add config as a new object so you can call arc config edit <edit_args> and add the respective ConfigAPI.fs, ConfigCommand.fs, and ConfigArgs.fs and add the helper functions to respective Configuration.fs files.

HLWeil commented 3 years ago

I'll merge this one and open an additional pull request with the next changes.