Esempio n. 1
0
        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));
        }
Esempio n. 2
0
        public static void KillJob(Arguments args)
        {
            var id = args.PopArg<int>();
            if (id == null)
            {
                ConsoleProc.TerminatingError("Expected: Client KillJob <id>");
            }

            // Execute command on server.
            RunCommand(() => CreateClient().KillJob(id.Value));
        }