diff options
| author | Michalis Adamidis <gsnerf@gsnerf.de> | 2014-09-14 18:00:44 +0200 |
|---|---|---|
| committer | Michalis Adamidis <gsnerf@gsnerf.de> | 2014-09-14 18:00:44 +0200 |
| commit | 411a0531e0a71b2d458b5b3a8a9951ca763ca09a (patch) | |
| tree | 871614a2cab9da0aa95d1d1f9f350d80fcf56271 /MediaBrowser.ServerApplication/IO | |
| parent | 4f3ea6c6c3cdde7f4b8d21dc97c711635d73b4e0 (diff) | |
| parent | 6a177d21478774b3ea1a5adc606935bb3aff65bf (diff) | |
Merge branch 'master' of https://github.com/MediaBrowser/MediaBrowser
Diffstat (limited to 'MediaBrowser.ServerApplication/IO')
| -rw-r--r-- | MediaBrowser.ServerApplication/IO/StartupOptions.cs | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/MediaBrowser.ServerApplication/IO/StartupOptions.cs b/MediaBrowser.ServerApplication/IO/StartupOptions.cs new file mode 100644 index 000000000..e74151e4c --- /dev/null +++ b/MediaBrowser.ServerApplication/IO/StartupOptions.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Linq; + +namespace MediaBrowser.ServerApplication.IO +{ + public class StartupOptions + { + private readonly List<string> _options = Environment.GetCommandLineArgs().ToList(); + + public bool ContainsOption(string option) + { + return _options.Contains(option, StringComparer.OrdinalIgnoreCase); + } + + public string GetOption(string name) + { + var index = _options.IndexOf(name); + + if (index != -1) + { + return _options.ElementAtOrDefault(index + 1); + } + + return null; + } + } +} |
