public static void RunJob(Arguments args) { const string ERROR_FORMAT = "{0} Expected: Client {1} <interval> <filename>"; // Get optional interval parameter. var secInterval = args.PopArg<int>(); if (secInterval == null) { ConsoleProc.TerminatingError(string.Format( ERROR_FORMAT, "Missing <interval> parameter.", nameof(RunJob))); } // Get required filename parameter. var filename = string.Join(" ", args.PopRemainingArgs()); if (string.IsNullOrWhiteSpace(filename)) { ConsoleProc.TerminatingError(string.Format( ERROR_FORMAT, "Missing <filename> parameter.", nameof(RunJob))); } // Execute command on server. RunCommand(() => CreateClient().RunJob( Directory.GetCurrentDirectory(), secInterval.Value, filename)); }
public static void Run(Arguments args) { // Get required filename parameter. var filename = string.Join(" ", args.PopRemainingArgs()); if (string.IsNullOrWhiteSpace(filename)) { ConsoleProc.TerminatingError( $"Expected: Client {nameof(Run)} <filename>"); } // Execute command on server. RunCommand(() => CreateClient().RunJob( Directory.GetCurrentDirectory(), 0, filename)); }