CompareShort() публичный статический Метод

public static CompareShort ( string argument, string option ) : bool
argument string
option string
Результат bool
Пример #1
0
        private bool ParseHelp(string[] args, HelpOptionAttribute helpOption)
        {
            bool caseSensitive = _settings.CaseSensitive;

            for (int i = 0; i < args.Length; i++)
            {
                if (!string.IsNullOrEmpty(helpOption.ShortName))
                {
                    if (ArgumentParser.CompareShort(args[i], helpOption.ShortName, caseSensitive))
                    {
                        return(true);
                    }
                }

                if (!string.IsNullOrEmpty(helpOption.LongName))
                {
                    if (ArgumentParser.CompareLong(args[i], helpOption.LongName, caseSensitive))
                    {
                        return(true);
                    }
                }
            }

            return(false);
        }
Пример #2
0
        private bool ParseHelp(string[] args, HelpOptionAttribute helpOption)
        {
            var caseSensitive = _settings.CaseSensitive;

            foreach (var arg in args)
            {
                if (helpOption.ShortName != null)
                {
                    if (ArgumentParser.CompareShort(arg, helpOption.ShortName, caseSensitive))
                    {
                        return(true);
                    }
                }

                if (string.IsNullOrEmpty(helpOption.LongName))
                {
                    continue;
                }

                if (ArgumentParser.CompareLong(arg, helpOption.LongName, caseSensitive))
                {
                    return(true);
                }
            }

            return(false);
        }
 private static bool ParseHelp(string[] args, HelpOptionAttribute helpOption)
 {
     for (int i = 0; i < args.Length; i++)
     {
         if (!string.IsNullOrEmpty(helpOption.ShortName))
         {
             if (ArgumentParser.CompareShort(args[i], helpOption.ShortName))
             {
                 return(true);
             }
         }
         if (!string.IsNullOrEmpty(helpOption.LongName))
         {
             if (ArgumentParser.CompareLong(args[i], helpOption.LongName))
             {
                 return(true);
             }
         }
     }
     return(false);
 }