Click or drag to resize

YArgumentParserGetArgument(String) Method

Get a YArgument from the argName. Throw a KeyNotFoundException if the given param is not found.
Example
C#
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.Library
Assembly: Upsilon.Common.Library (in Upsilon.Common.Library.dll) Version: 2.2.2+14985a67b419f90e14e6b1bde61d18cf6cf12b27
Syntax
C#
public YArgument GetArgument(
	string argName
)

Parameters

argName  String
The argument name.

Return Value

YArgument
Returns the YArgument or null
Remarks
Giving string.Empty to the argName param will return the main YArguments
See Also