internal static List<string> FindDefaultShortcuts(PropertyInfo info, List<string> knownShortcuts, bool ignoreCase)
{
List<string> ret = new List<string>();
bool excludeName = info.Attrs<ArgShortcut>().Where(s => s.Policy == ArgShortcutPolicy.ShortcutsOnly).Count() > 0;
if (excludeName == false)
{
knownShortcuts.Add(info.Name);
if (CommandLineAction.IsActionImplementation(info) && info.Name.EndsWith(Constants.ActionArgConventionSuffix))
{
ret.Add(info.Name.Substring(0, info.Name.Length - Constants.ActionArgConventionSuffix.Length));
}
else
{
ret.Add(info.Name);
}
}
var attrs = info.Attrs<ArgShortcut>();
if (attrs.Count == 0)
{
var shortcut = GenerateShortcutAlias(info.Name, knownShortcuts, ignoreCase);
if (shortcut != null)
{
knownShortcuts.Add(shortcut);
ret.Add(shortcut);
}
return ret;
}
else
{
return ret;
}
}