Page MenuHomewrite.as

load global config from file
Open, Thinking, LowPublic

Description

I'm hoping to have the tool load the configuration files, when present, from the configured directory on application execution.

The main thing I'm trying to figure out at the moment is how to access that data from within the shared code, in sub packages.

  • There is no easy way I can see so far, that allows accessing arbitrary data from the cli framework.

Event Timeline

robjloranger created this object with visibility "Public (No Login Required)".
robjloranger created this object with edit policy "All Users".
robjloranger changed the task status from Open to Thinking.
robjloranger triaged this task as Low priority.

it might not be as important as I think, the tool really only runs through once so as long as they share the loading and parsing code there is no need to load it at the start. just on demand and only if needed

I found a way to pass information down the stack with the cli.Context.

one is with App.ExtraInfo which is a function that returns a map of string/string. The function can be anything that returns the map, so could parse other config info into it.

matt added a comment.Wed, Jun 5, 7:58 PM

TODO: is this WF-only? Or both CLIs?

Will be both, I'm thinking of loading the config at the start of each command and pass it down through calls. Some command paths may call LoadConfig 2 or 3 times which is a waste.

I think maybe both LoadUser and LoadConfig should be called and create some combined data structure for AppConfig which would be passed around during a command execution.

robjloranger moved this task from Backlog to Soon on the WriteFreely CLI board.Thu, Jun 13, 2:18 AM
robjloranger moved this task from Soon to Next Up on the WriteFreely CLI board.
robjloranger removed a project: Restricted Project.Thu, Jun 13, 3:08 AM