static int Main(string [] args) { try { Munxap unxap = new Munxap(); var p = new OptionSet() { { "h|?|help", v => unxap.Help = v != null }, }; List <string> rest = new List <string> (); try { rest = p.Parse(args); } catch (OptionException) { Console.Error.WriteLine("Try `munxap --help' for more information."); return(1); } if (unxap.Help) { ShowHelp(p); return(0); } if (rest.Count != 1) { ShowHelp(p); return(1); } unxap.File = rest [0]; unxap.Show(); return(0); } catch (Exception ex) { Console.WriteLine(ex); return(1); } }
static int Main (string [] args) { try { Munxap unxap = new Munxap (); var p = new OptionSet () { { "h|?|help", v => unxap.Help = v != null }, }; List<string> rest = new List<string> (); try { rest = p.Parse (args); } catch (OptionException){ Console.Error.WriteLine ("Try `munxap --help' for more information."); return 1; } if (unxap.Help) { ShowHelp (p); return 0; } if (rest.Count != 1) { ShowHelp (p); return 1; } unxap.File = rest [0]; unxap.Show (); return 0; } catch (Exception ex) { Console.WriteLine (ex); return 1; } }