Click or drag to resize

YArgumentParserArgumentIsSet Method

Overload List
  Name Description
Public method Code example ArgumentIsSet(String) Check if the argName is set as a boolean.
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"
});
In results :
  • argumentParser.ArgumentIsSet(string.Empty) will return false because the main argument cannot be set as boolean
  • argumentParser.ArgumentIsSet("s") will return false because this argument is not set as boolean
  • argumentParser.ArgumentIsSet("readonly") will return true
  • argumentParser.ArgumentIsSet("override") will return false
Public method Code example ArgumentIsSetT(T) Check if the argName is set as a boolean.
Example
C#
enum ArumentsTypes
{
    main = 0,
    s,
    m,
    readonly,
}
YArgumentParser argumentParser = new YArgumentParser(new string[]
{ 
    "First value of the main argument",
    "Second value of the main argument",
    "-s",
    "source",
    "/d",
    "destination",
    "-readonly"
});
In results :
  • argumentParser.ArgumentIsSet(ArumentsTypes.main) will return false because the main argument cannot be set as boolean
  • argumentParser.ArgumentIsSet(ArumentsTypes.s) will return false because this argument is not set as boolean
  • argumentParser.ArgumentIsSet(ArumentsTypes.readonly) will return true
  • argumentParser.ArgumentIsSet(ArumentsTypes.m) will return false
Top
See Also