diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2014-05-01 22:54:33 -0400 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2014-05-01 22:54:33 -0400 |
| commit | c7c72dd1a89217f48cb48db93d9ee1fa5ee6171d (patch) | |
| tree | 71c47742119e3f546f2a34f01777b2288fa83979 /MediaBrowser.Server.Mono/Program.cs | |
| parent | c741082dfd709e20e9b762028a684d39755ecd28 (diff) | |
web client re-org
Diffstat (limited to 'MediaBrowser.Server.Mono/Program.cs')
| -rw-r--r-- | MediaBrowser.Server.Mono/Program.cs | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/MediaBrowser.Server.Mono/Program.cs b/MediaBrowser.Server.Mono/Program.cs index e1d3cda40..b849c7a44 100644 --- a/MediaBrowser.Server.Mono/Program.cs +++ b/MediaBrowser.Server.Mono/Program.cs @@ -41,10 +41,8 @@ namespace MediaBrowser.Server.Mono var applicationPath = Assembly.GetEntryAssembly ().Location; #endif - var commandArgs = Environment.GetCommandLineArgs(); - // Allow this to be specified on the command line. - var customProgramDataPath = commandArgs.ElementAtOrDefault(1); + var customProgramDataPath = ParseCommandLine(); var appPaths = CreateApplicationPaths(applicationPath, customProgramDataPath); @@ -75,6 +73,20 @@ namespace MediaBrowser.Server.Mono _appHost.Dispose(); } } + + private static string ParseCommandLine() + { + var commandArgs = Environment.GetCommandLineArgs().ToList(); + + var programDataPathIndex = commandArgs.IndexOf("-programdata"); + + if (programDataPathIndex != -1) + { + return commandArgs.ElementAtOrDefault(programDataPathIndex + 1); + } + + return null; + } private static ServerApplicationPaths CreateApplicationPaths(string applicationPath, string programDataPath) { |
