From f9807884a425c2d91e8f2035993a0ca5e210eb43 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Wed, 25 Nov 2009 15:28:43 +0000 Subject: Add MIT/X11 licensed NDesk.Options (http://www.ndesk.org/Options) DLL to aid command line parsing --- CONTRIBUTORS.txt | 1 + .../Region/CoreModules/World/Archiver/ArchiverModule.cs | 10 +++++++++- bin/NDesk.Options.dll | Bin 0 -> 22016 bytes prebuild.xml | 1 + 4 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 bin/NDesk.Options.dll diff --git a/CONTRIBUTORS.txt b/CONTRIBUTORS.txt index ee263a1..8744a08 100644 --- a/CONTRIBUTORS.txt +++ b/CONTRIBUTORS.txt @@ -158,6 +158,7 @@ This software uses components from the following developers: * Nini (http://nini.sourceforge.net/) * log4net (http://logging.apache.org/log4net/) * GlynnTucker.Cache (http://gtcache.sourceforge.net/) +* NDesk.Options 0.2.1 (http://www.ndesk.org/Options) Some plugins are based on Cable Beach Cable Beach is Copyright (c) 2008 Intel Corporation diff --git a/OpenSim/Region/CoreModules/World/Archiver/ArchiverModule.cs b/OpenSim/Region/CoreModules/World/Archiver/ArchiverModule.cs index 181f4c6..98fdec3 100644 --- a/OpenSim/Region/CoreModules/World/Archiver/ArchiverModule.cs +++ b/OpenSim/Region/CoreModules/World/Archiver/ArchiverModule.cs @@ -26,9 +26,11 @@ */ using System; +using System.Collections.Generic; using System.IO; using System.Reflection; using log4net; +using NDesk.Options; using Nini.Config; using OpenSim.Region.Framework.Interfaces; using OpenSim.Region.Framework.Scenes; @@ -91,7 +93,13 @@ namespace OpenSim.Region.CoreModules.World.Archiver /// public void HandleLoadOarConsoleCommand(string module, string[] cmdparams) { - if (cmdparams.Length > 2) + OptionSet options = new OptionSet() {}; + List mainParams = options.Parse(cmdparams); + + foreach (string param in mainParams) + m_log.DebugFormat("Found param [{0}]", param); + + if (mainParams.Count > 2) { DearchiveRegion(cmdparams[2]); } diff --git a/bin/NDesk.Options.dll b/bin/NDesk.Options.dll new file mode 100644 index 0000000..df45878 Binary files /dev/null and b/bin/NDesk.Options.dll differ diff --git a/prebuild.xml b/prebuild.xml index 26535fb..ad06938 100644 --- a/prebuild.xml +++ b/prebuild.xml @@ -1596,6 +1596,7 @@ + -- cgit v1.1