private string GetArgValue(CommandlineSwitchType t)
        {
            if (_parsedArguments.HasValue(t))
                return _parsedArguments.GetValue(t);

            return string.Empty;
        }
Exemple #2
0
        private ParsedArguments GetSwitchDictionary(
            string[] args)
        {
            var result = new ParsedArguments();

            int indexOfSwitch = 0;

            while (indexOfSwitch < args.Length)
            {
                var switchArg  = args[indexOfSwitch];
                var switchType = CommandlineSwitchType.GetTypeForCommandLineSwitch(switchArg);

                var indexOfSwitchValue = indexOfSwitch + 1;

                if (WeHaveMatchingCommandLineSwitch(switchType) &&
                    ArgsIsLargeEnoughtToSupportSwitchValue(args, indexOfSwitchValue))

                {
                    var switchValue = args[indexOfSwitchValue];
                    result.SetValue(switchType, switchValue);
                }

                indexOfSwitch += 2;
            }

            return(result);
        }
 private bool WeHaveMatchingCommandLineSwitch(
     CommandlineSwitchType c)
 {
     return c != null;
 }
 public void SetValue(
     CommandlineSwitchType c,
     string v)
 {
     _switchDictionary.Add(c, v);
 }
 public bool HasValue(
     CommandlineSwitchType c)
 {
     return _switchDictionary.ContainsKey(c);
 }
 public string GetValue(
     CommandlineSwitchType c)
 {
     return _switchDictionary[c];
 }
Exemple #7
0
 private bool WeHaveMatchingCommandLineSwitch(
     CommandlineSwitchType c)
 {
     return(c != null);
 }