Esempio n. 1
0
        public AwsConnectionArgument GetFrom(IEnumerable <Argument> args)
        {
            var argValues = ArgumentDefinition.GetValues(_usedArguments, args);

            var accessKey = argValues[AccessArg.Name];
            var secretKey = argValues[SecretArg.Name];
            var region    = argValues[RegionArg.Name];

            return(new AwsConnectionArgument(accessKey, secretKey, region));
        }
Esempio n. 2
0
        public OperationArgument GetFrom(IEnumerable <Argument> args)
        {
            var argValues = ArgumentDefinition.GetValues(_usedArguments, args);

            var isValid = Mappings.TryGetValue(argValues[OperationArg.Name], out Type type);

            if (!isValid)
            {
                throw new InvalidOperationException($"Unsupported operation: '{argValues[OperationArg.Name]}'.");
            }

            var bucket = argValues[BucketArg.Name];
            var prefix = argValues[PrefixArg.Name];
            var dryRun = bool.Parse(argValues[DryRunArg.Name]);

            return(new OperationArgument(type, new OperationOptions(bucket, prefix, dryRun)));
        }