Replies: 3 comments 5 replies
-
Ive found a nasty solution! Not proud of it! I created a
|
Beta Was this translation helpful? Give feedback.
-
While i haven't done anything like this myself, wouldn't |
Beta Was this translation helpful? Give feedback.
-
I found something a little bit cleaner. Create a fake command that uses a settings class derived from the one you want. Add enough positional arguments to soak up your actual commands:
Set this to a static property in your Program.cs or use in anything static:
|
Beta Was this translation helpful? Give feedback.
-
I'm running the commands within a
Host
, and during setup of the host, I need to get the value of--config
so that it can be added to the configuration during the host's setup.Would there be an easy/elegant way to grab the parsed CommandSettings?
I'm thinking that a really hacky way to do this would be to have a fake
CommandApp
that I run first to grab the settings, and then launch the rest of the app.What I would prefer is some way to parse settings from the
Args
outside of the main system.I'll be throwing away this object, but I would let me grab some context for how the application is setup before the
CommandApp
is loaded.Beta Was this translation helpful? Give feedback.
All reactions