コード例 #1
0
        private void CheckForOptionErrors()
        {
            foreach (var option in AppliedOptions.FlattenBreadthFirst())
            {
                var error = option.Validate();

                if (error != null)
                {
                    errors.Add(error);
                }
            }
        }
コード例 #2
0
ファイル: ParseResult.cs プロジェクト: ssa3512/CsprojToVs2017
        private void CheckForErrors()
        {
            foreach (var option in AppliedOptions.FlattenBreadthFirst())
            {
                var error = option.Validate();

                if (error != null)
                {
                    errors.Add(error);
                }
            }

            var command = Command();

            if (command != null &&
                command.DefinedOptions.Any(o => o.IsCommand))
            {
                errors.Insert(0, new OptionError(
                                  RequiredCommandWasNotProvided(),
                                  command.Name,
                                  this.AppliedCommand()));
            }
        }
コード例 #3
0
ファイル: ParseResult.cs プロジェクト: ssa3512/CsprojToVs2017
 public Command Command() =>
 command ??
 (command = configuration.RootCommandIsImplicit
                    ? configuration.DefinedOptions.OfType <Command>().Single()
                    : AppliedOptions.Command());
コード例 #4
0
 public bool HasOption(string alias) => AppliedOptions.Contains(alias);