Class ProgramCommon
- Namespace
- SunamoCl.SunamoCmdArgs_Cmd
- Assembly
- SunamoCl.dll
Helper for parsing command-line arguments into typed options and resolving the application mode
public class ProgramCommon
- Inheritance
-
ProgramCommon
- Inherited Members
- Extension Methods
Methods
ProcessArgs<T, Mode>(string[], Mode)
Parses command-line arguments into typed options and resolves the application mode. For apps that did not use Mode, ModeCl can be used. Mode is no longer used for new applications.
public Tuple<T, Mode>? ProcessArgs<T, Mode>(string[] args, Mode defaultMode) where T : CommonArgs where Mode : struct
Parameters
argsstring[]Command-line arguments to parse
defaultModeModeDefault mode to use when parsing fails
Returns
- Tuple<T, Mode>
Tuple of parsed arguments and resolved mode, or null on failure
Type Parameters
TArguments type inheriting from CommonArgs
ModeEnum type representing available application modes