Example #1
0
        private bool ValidateRequiredCommonArguments(IEnumerable <IArgument> args, out string message)
        {
            message = string.Empty;

            var required = ArgumentHelper.GetCommonArguments().Where(x => x.IsRequired && x.ArgumentKind != ArgumentKind.ExecCsv && x.ArgumentKind != ArgumentKind.ExecPdf);
            var target   = args.Where(x => x.IsRequired);

            if (required.All(x => target.Select(y => y.ArgumentKind).Contains(x.ArgumentKind)))
            {
                return(true);
            }

            var extracted = this.Extract(required, target);

            message = $"必須オプションが不足しています : {extracted.Select(x => x.Alias.Join(" | ")).Join(", ")}";

            return(false);
        }
Example #2
0
 public CommonArgumentResolver() : base(ArgumentHelper.GetCommonArguments())
 {
 }