/// <summary> /// Helper method to validate that all arguments have been provided, obtain a StorageClient, /// and then call the given command. We might want to make this an extension method at some point. /// </summary> private static void ConfigureForExecution(CommandLineApplication config, Func <StorageClient, Task> command) { config.OnExecute(async() => { foreach (var argument in config.Arguments) { if (argument.Values.Count == 0) { Console.WriteLine($"Argument '{argument.Name}' not specified"); return(1); } } try { var client = await StorageClient.FromApplicationCredentials("Demo"); await command(client); return(0); } catch (Exception e) { Console.WriteLine(e); return(1); } }); }
private CloudConfiguration(string project) { Project = project; Client = Task.Run(async() => await StorageClient.FromApplicationCredentials("Test")).Result; TempBucketPrefix = Project + "_integrationtests-"; }