There are a number within the System.CommandLine flow that could potentially supply information used by later steps. From one perspective this is a core part of the process because a return code (exit code) is returned that we anticipate will be the return value of Main.
#2156 discusses what should be returned from the flow. This the broader question about what state/data should be available during execution.
Several things could supply data that could be used by later steps:
In the old middleware pipeline, closures could be used to stash data between the before/after next step phases, but I do not think there were other ways to share state/data.
Have you ever wished a custom parser could stash some information for use by an action? Any other variation of wanting data to pass between parts of your parser?
There are a number within the System.CommandLine flow that could potentially supply information used by later steps. From one perspective this is a core part of the process because a return code (exit code) is returned that we anticipate will be the return value of Main.
#2156 discusses what should be returned from the flow. This the broader question about what state/data should be available during execution.
Several things could supply data that could be used by later steps:
static void Main(..)CliActionto be non-exclusive #2147)In the old middleware pipeline, closures could be used to stash data between the before/after next step phases, but I do not think there were other ways to share state/data.
Have you ever wished a custom parser could stash some information for use by an action? Any other variation of wanting data to pass between parts of your parser?