private static int RunPrintAndReturnExitCode(PrintOptions opts) { GMD gmd; Console.WriteLine("File: " + opts.Path); try { gmd = new GMD(opts.Path); } catch (Exception ex) { Console.WriteLine("Error: " + ex.Message); return(1); } foreach (var entry in gmd.Entries) { string key = "\"\""; string value = '"' + entry.Value + '"'; if (entry as GMD_Entry is var x && x != null) { key = '"' + x.Key + '"'; }
private static int Print(PrintOptions opts) { GMD gmd; Console.WriteLine("File: " + opts.Path); try { gmd = new GMD(opts.Path); } catch (Exception ex) { Console.WriteLine("Error: " + ex.Message); return(1); } foreach (var entry in gmd.Entries) { PrintEntry(entry); } return(0); }