YArgumentParserGetArgument(String) Method
|
Get a
YArgument from the
argName. Throw a KeyNotFoundException if the given param is not found.
Example YArgumentParser argumentParser = new YArgumentParser(new string[]
{
"First value of the main argument",
"Second value of the main argument",
"-s",
"source",
"/d",
"destination",
"-readonly"
});
YArgument argument = argumentParser.GetArgument("s");
YArgument mainArgument = argumentParser.GetArgument(string.Empty);
YArgument nullArgument = argumentParser.GetArgument("m");
In results :
- argument.Values will be { "source" }
- mainArgument.Values will be { "First value of the main argument", "Second value of the main argument"}
- nullArgument will be null
Namespace: Upsilon.Common.LibraryAssembly: Upsilon.Common.Library (in Upsilon.Common.Library.dll) Version: 2.2.2+14985a67b419f90e14e6b1bde61d18cf6cf12b27
Syntax public YArgument GetArgument(
string argName
)
Parameters
- argName String
- The argument name.
Return Value
YArgumentReturns the
YArgument or
nullRemarks Giving string.Empty to the argName param will return the main YArguments
See Also