Fixed checking for modeset on start.

master
Sean McArdle 2017-03-03 12:00:59 -08:00
parent 599e5d197c
commit dee7592ae6
2 changed files with 6 additions and 4 deletions

View File

@ -23,7 +23,7 @@ namespace WifiSitter
var opts = new OptionSet() {
{"h|?|help", "Show this help and exit.",
v => showHelp = v != null },
{"i|ipc", "Enable IPC communication for GUI.",
{"i|ipc", "Option to enable IPC communication for GUI.",
v => enableIPC = v != null},
{"console|service", "Direct wifisitter mode of operation.",
v => mode = v.ToLower() },
@ -49,7 +49,9 @@ namespace WifiSitter
return _options[key];
}
public static bool OptionsSet { get { return _options != null; } }
public static bool IsOptionsSet { get { return _options != null; } }
public static bool IsModeSet { get { if (IsOptionsSet) { return !String.IsNullOrEmpty((string)_options["operating_mode"]); }; return false; } }
public static void ShowHelp(OptionSet opts, int exitCode = 0) {
Console.WriteLine("Usage: wifisitter.exe [option] [directive]");

View File

@ -72,11 +72,11 @@ USAGE
{
Environment.CurrentDirectory = AppDomain.CurrentDomain.BaseDirectory;
if (!Configuration.OptionsSet && Debugger.IsAttached)
if (!Configuration.IsModeSet && Debugger.IsAttached)
{
Configuration.SetOptions( new[] { "--console" } );
}
else if (!Configuration.OptionsSet) {
else if (!Configuration.IsModeSet) {
Configuration.SetOptions(new[] { "-h" });
}