Command Option 增强及示例
This commit is contained in:
@@ -9,11 +9,14 @@ namespace AibisDream
|
||||
{
|
||||
private const string COMMAND_ATTR = "command";
|
||||
|
||||
private const string OptionAttr = "options";
|
||||
|
||||
private const string COMMAND_PROP = "name";
|
||||
|
||||
|
||||
public static bool HasCommandAttr(this MarkupParseResult text)
|
||||
{
|
||||
return text.TryGetAttributeWithName(COMMAND_ATTR, out var attribute);
|
||||
return text.TryGetAttributeWithName(COMMAND_ATTR, out var attribute1) ||
|
||||
text.TryGetAttributeWithName(OptionAttr, out var attribute2);
|
||||
}
|
||||
|
||||
public static bool TryGetCommandAttr(this MarkupParseResult text, out string commandName)
|
||||
@@ -22,5 +25,10 @@ namespace AibisDream
|
||||
commandName = res ? attribute.Properties[COMMAND_PROP].StringValue : null;
|
||||
return res;
|
||||
}
|
||||
|
||||
public static bool IsOptionAttrLine(this MarkupParseResult text)
|
||||
{
|
||||
return text.TryGetAttributeWithName(OptionAttr, out var outStr);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user