Class CmdlineParseItem
- Namespace
- SearchAThing.Cmdline
- Assembly
- netcore-cmdline.dll
describe properties required for a command, a flag or a parameter on the syntax for the cmdline parser; enumerating returns the list of values if this is a flag with value or a parameter or a parameter array
public class CmdlineParseItem : IEnumerable<string>, IEnumerable
- Inheritance
-
CmdlineParseItem
- Implements
- Inherited Members
Properties
ArgValues
original cmdline argument associated as value to this item (may a flag with value or parameter)
public IReadOnlyList<CmdlineArgument> ArgValues { get; }
Property Value
Description
description for this parse item to use in the usage or is parser description if this is a command
public string Description { get; }
Property Value
GlobalFlagAction
stores actiont to execute if this global flag item matches
public Action<CmdlineParseItem> GlobalFlagAction { get; }
Property Value
GlobalFlagActionNested
if false global flag action will executed immeditaly; if true execution will deferred to nested parser
public bool GlobalFlagActionNested { get; }
Property Value
HasLongName
states if this element has a long name ( used only for flags )
public bool HasLongName { get; }
Property Value
HasShortName
true if this item has a short name ( maybe a command, parameter or a flag with short name )
public bool HasShortName { get; }
Property Value
HasValueName
states if this flag requires a value
public bool HasValueName { get; }
Property Value
IsCommand
true if this is a command
public bool IsCommand { get; }
Property Value
IsFlag
true if this is a flag
public bool IsFlag { get; }
Property Value
IsGlobal
states if this parse item is a global flag
public bool IsGlobal { get; }
Property Value
IsParameter
true if this is a parameter
public bool IsParameter { get; }
Property Value
IsParameterArray
true is this is an array of parameters
public bool IsParameterArray { get; }
Property Value
IsParameterOrArray
true if this is a parameter or array of parameters
public bool IsParameterOrArray { get; }
Property Value
LongFlag
states if this item have a long name ( used only for flags )
public string LongFlag { get; }
Property Value
LongName
long name ( used only for flags )
public string LongName { get; }
Property Value
Mandatory
true if this item is mandatory
public bool Mandatory { get; }
Property Value
MatchArgument
original argument with that this parse item matches
public CmdlineArgument MatchArgument { get; }
Property Value
MatchParser
used to distinguish sub parser for global flags
public CmdlineParser MatchParser { get; }
Property Value
Matches
states if this flag have a matching with required usage
public bool Matches { get; }
Property Value
Parser
parser which this item belongs to
public CmdlineParser Parser { get; }
Property Value
ShortFlag
short flag final string ( without value if any )
public string ShortFlag { get; }
Property Value
ShortLongFlag
short/long flag final string ( without value if any )
public string ShortLongFlag { get; }
Property Value
ShortName
short name of this element
public string ShortName { get; }
Property Value
SortOrder
helper to sort items in groups with follow order Commands, Flags, Parameters, Parameters array
public int SortOrder { get; }
Property Value
Type
type of this cmdline parser
public CmdlineParseItemType Type { get; }
Property Value
ValueName
symbolic name for the flag value to display in the usage
public string ValueName { get; }
Property Value
Values
values associated to this item (may a flag with value or parameter)
public IReadOnlyList<string> Values { get; }
Property Value
Methods
GetEnumerator()
public IEnumerator<string> GetEnumerator()
Returns
OnCompletion(Func<string, IEnumerable<string>>)
set a runtime completion function ( used for parameter item types )
public void OnCompletion(Func<string, IEnumerable<string>> func)
Parameters
func
Func<string, IEnumerable<string>>
Operators
implicit operator bool(CmdlineParseItem)
helper to check if this parse item meet usage rules
public static implicit operator bool(CmdlineParseItem item)
Parameters
item
CmdlineParseItem
Returns
implicit operator string(CmdlineParseItem)
helper to retrieve this item value ( used for flag value or single parameter )
public static implicit operator string(CmdlineParseItem item)
Parameters
item
CmdlineParseItem