What is the standard way of storing a command line argument so that it can be accessed when required?
I can see 2 scenarios:
- The argument is consumed immediately (A logging level)
- The argument is not needed immediately (On failure send email to address X)
With scenario 1 It would seem quite natural to configure it upfront, however when it is a scenario more in the vein of scenario 2 I would prefer to configure that component as and when necessary (IE not up front)
So to phrase the question slightly differently how do I make my configuration options available to my entire application?
You can use something like that (you can store the CommandLine somewhere or use the opions right away):