Exemplo n.º 1
0
        private static string GetCode()
        {
            if (NamedArguments.TryGetAs("CodeFile", out string codeFile))
            {
                return(File.ReadAllText(codeFile));
            }

            if (NamedArguments.TryGetAs("CodeText", out string codeText))
            {
                return(codeText);
            }

            Console.WriteLine("Missing code argument. Use either \"--CodeFile\" or \"--CodeText\" argument to input the code.");
            Environment.Exit(1);
            return(null);
        }
Exemplo n.º 2
0
 private static bool TryGetInput(out string input)
 {
     return(NamedArguments.TryGetAs("InputText", out input) ||
            NamedArguments.TryGetAs("InputFile", out input));
 }