private static AppOptions ParseCommandLine(string[] args) { var appOptions = new AppOptions(); try { appOptions.Parse(args); } catch (Exception ex) { Console.WriteLine(ex.Message); Environment.Exit(2); } return appOptions; }
private static void ShowHelp(AppOptions appOptions) { Console.WriteLine("Usage:"); Console.WriteLine("snifter -i x -f filename"); Console.WriteLine(); Console.WriteLine(appOptions.OptionsHelpText); Console.WriteLine(); var nicInfos = NetworkInterfaceInfo.GetInterfaces(); Console.WriteLine("ID\tIP Address\tName"); Console.WriteLine("==========================================================="); foreach (var nicInfo in nicInfos) { Console.WriteLine("{0}\t{1}\t{2}", nicInfo.Index, nicInfo.IPAddress, nicInfo.Name); } }