You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucenenet.apache.org by ni...@apache.org on 2017/07/11 07:42:26 UTC

[01/22] lucenenet git commit: Added lucene-cli + tests - a wrapper console application so we can run the various utilities and demos in .NET on the command line.

Repository: lucenenet
Updated Branches:
  refs/heads/master 9a8c9f203 -> e8e1b5a9c


http://git-wip-us.apache.org/repos/asf/lucenenet/blob/9e389540/src/tools/lucene-cli/commands/index/index-upgrade/IndexUpgradeCommand.cs
----------------------------------------------------------------------
diff --git a/src/tools/lucene-cli/commands/index/index-upgrade/IndexUpgradeCommand.cs b/src/tools/lucene-cli/commands/index/index-upgrade/IndexUpgradeCommand.cs
new file mode 100644
index 0000000..f849bb5
--- /dev/null
+++ b/src/tools/lucene-cli/commands/index/index-upgrade/IndexUpgradeCommand.cs
@@ -0,0 +1,83 @@
+using Lucene.Net.Cli.CommandLine;
+using Lucene.Net.Index;
+using System.Collections.Generic;
+
+namespace Lucene.Net.Cli
+{
+    /*
+     * Licensed to the Apache Software Foundation (ASF) under one or more
+     * contributor license agreements.  See the NOTICE file distributed with
+     * this work for additional information regarding copyright ownership.
+     * The ASF licenses this file to You under the Apache License, Version 2.0
+     * (the "License"); you may not use this file except in compliance with
+     * the License.  You may obtain a copy of the License at
+     *
+     *     http://www.apache.org/licenses/LICENSE-2.0
+     *
+     * Unless required by applicable law or agreed to in writing, software
+     * distributed under the License is distributed on an "AS IS" BASIS,
+     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     * See the License for the specific language governing permissions and
+     * limitations under the License.
+     */
+
+    public class IndexUpgradeCommand : ICommand
+    {
+        public class Configuration : ConfigurationBase
+        {
+            public Configuration(CommandLineOptions options)
+            {
+                this.Main = (args) => IndexUpgrader.Main(args);
+
+                this.Name = "upgrade";
+                this.Description = FromResource("Description");
+
+                this.Arguments.Add(new IndexDirectoryArgument());
+                this.DeletePriorCommitsOption = this.Option("-d|--delete-prior-commits",
+                    FromResource("DeleteDescription"), 
+                    CommandOptionType.NoValue);
+                this.Options.Add(new VerboseOption());
+                this.Options.Add(new DirectoryTypeOption());
+                
+                this.ExtendedHelpText = FromResource("ExtendedHelpText");
+
+                this.OnExecute(() => new IndexUpgradeCommand().Run(this));
+            }
+
+            public virtual CommandOption DeletePriorCommitsOption { get; private set; }
+        }
+
+        public int Run(ConfigurationBase cmd)
+        {
+            if (!cmd.ValidateArguments(1))
+            {
+                return 1;
+            }
+
+            var args = new List<string>() { cmd.GetArgument<IndexDirectoryArgument>().Value };
+            var input = cmd as Configuration;
+            
+            if (input.DeletePriorCommitsOption != null && input.DeletePriorCommitsOption.HasValue())
+            {
+                args.Add("-delete-prior-commits");
+            }
+
+            // get vebose option
+            var verboseOption = cmd.GetOption<VerboseOption>();
+            if (verboseOption != null && verboseOption.HasValue())
+            {
+                args.Add("-verbose");
+            }
+
+            var directoryTypeOption = cmd.GetOption<DirectoryTypeOption>();
+            if (directoryTypeOption != null && directoryTypeOption.HasValue())
+            {
+                args.Add("-dir-impl");
+                args.Add(directoryTypeOption.Value());
+            }
+
+            cmd.Main(args.ToArray());
+            return 0;
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/9e389540/src/tools/lucene-cli/commands/lock/LockCommand.cs
----------------------------------------------------------------------
diff --git a/src/tools/lucene-cli/commands/lock/LockCommand.cs b/src/tools/lucene-cli/commands/lock/LockCommand.cs
new file mode 100644
index 0000000..69ed17c
--- /dev/null
+++ b/src/tools/lucene-cli/commands/lock/LockCommand.cs
@@ -0,0 +1,42 @@
+namespace Lucene.Net.Cli
+{
+    /*
+     * Licensed to the Apache Software Foundation (ASF) under one or more
+     * contributor license agreements.  See the NOTICE file distributed with
+     * this work for additional information regarding copyright ownership.
+     * The ASF licenses this file to You under the Apache License, Version 2.0
+     * (the "License"); you may not use this file except in compliance with
+     * the License.  You may obtain a copy of the License at
+     *
+     *     http://www.apache.org/licenses/LICENSE-2.0
+     *
+     * Unless required by applicable law or agreed to in writing, software
+     * distributed under the License is distributed on an "AS IS" BASIS,
+     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     * See the License for the specific language governing permissions and
+     * limitations under the License.
+     */
+
+    public class LockCommand : ICommand
+    {
+        public class Configuration : ConfigurationBase
+        {
+            public Configuration(CommandLineOptions options)
+            {
+                this.Name = "lock";
+                this.Description = FromResource("Description");
+
+                this.Commands.Add(new LockStressTestCommand.Configuration(options));
+                this.Commands.Add(new LockVerifyServerCommand.Configuration(options));
+
+                this.OnExecute(() => new LockCommand().Run(this));
+            }
+        }
+
+        public int Run(ConfigurationBase cmd)
+        {
+            cmd.ShowHelp();
+            return 1;
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/9e389540/src/tools/lucene-cli/commands/lock/lock-stress-test/LockStressTestCommand.cs
----------------------------------------------------------------------
diff --git a/src/tools/lucene-cli/commands/lock/lock-stress-test/LockStressTestCommand.cs b/src/tools/lucene-cli/commands/lock/lock-stress-test/LockStressTestCommand.cs
new file mode 100644
index 0000000..9b0f908
--- /dev/null
+++ b/src/tools/lucene-cli/commands/lock/lock-stress-test/LockStressTestCommand.cs
@@ -0,0 +1,58 @@
+using Lucene.Net.Store;
+
+namespace Lucene.Net.Cli
+{
+    /*
+     * Licensed to the Apache Software Foundation (ASF) under one or more
+     * contributor license agreements.  See the NOTICE file distributed with
+     * this work for additional information regarding copyright ownership.
+     * The ASF licenses this file to You under the Apache License, Version 2.0
+     * (the "License"); you may not use this file except in compliance with
+     * the License.  You may obtain a copy of the License at
+     *
+     *     http://www.apache.org/licenses/LICENSE-2.0
+     *
+     * Unless required by applicable law or agreed to in writing, software
+     * distributed under the License is distributed on an "AS IS" BASIS,
+     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     * See the License for the specific language governing permissions and
+     * limitations under the License.
+     */
+
+    public class LockStressTestCommand : ICommand
+    {
+        public class Configuration : ConfigurationBase
+        {
+            public Configuration(CommandLineOptions options)
+            {
+                this.Main = (args) => LockStressTest.Main(args);
+
+                this.Name = "stress-test";
+                this.Description = FromResource("Description");
+
+                this.Argument("<ID>", FromResource("IDDescription"));
+                this.Argument("<VERIFIER_HOST>", FromResource("VerifierHostDescription"));
+                this.Argument("<VERIFIER_PORT>", FromResource("VerfierPortDescription"));
+                this.Argument("<LOCK_FACTORY_TYPENAME>", FromResource("LockFactoryTypeNameDescription"));
+                this.Argument("<LOCK_DIRECTORY_NAME>", FromResource("LockFactoryNameDescription"));
+                this.Argument("<SLEEP_TIME_MS>", FromResource("SleepTimeMSDescription"));
+                this.Argument("<COUNT>", FromResource("CountDescription"));
+
+                this.ExtendedHelpText = FromResource("ExtendedHelpText");
+
+                this.OnExecute(() => new LockStressTestCommand().Run(this));
+            }
+        }
+
+        public int Run(ConfigurationBase cmd)
+        {
+            if (!cmd.ValidateArguments(7))
+            {
+                return 1;
+            }
+
+            cmd.Main(cmd.GetNonNullArguments());
+            return 0;
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/9e389540/src/tools/lucene-cli/commands/lock/lock-verify-server/LockVerifyServerCommand.cs
----------------------------------------------------------------------
diff --git a/src/tools/lucene-cli/commands/lock/lock-verify-server/LockVerifyServerCommand.cs b/src/tools/lucene-cli/commands/lock/lock-verify-server/LockVerifyServerCommand.cs
new file mode 100644
index 0000000..0095888
--- /dev/null
+++ b/src/tools/lucene-cli/commands/lock/lock-verify-server/LockVerifyServerCommand.cs
@@ -0,0 +1,51 @@
+using Lucene.Net.Store;
+
+namespace Lucene.Net.Cli
+{
+    /*
+     * Licensed to the Apache Software Foundation (ASF) under one or more
+     * contributor license agreements.  See the NOTICE file distributed with
+     * this work for additional information regarding copyright ownership.
+     * The ASF licenses this file to You under the Apache License, Version 2.0
+     * (the "License"); you may not use this file except in compliance with
+     * the License.  You may obtain a copy of the License at
+     *
+     *     http://www.apache.org/licenses/LICENSE-2.0
+     *
+     * Unless required by applicable law or agreed to in writing, software
+     * distributed under the License is distributed on an "AS IS" BASIS,
+     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     * See the License for the specific language governing permissions and
+     * limitations under the License.
+     */
+
+    public class LockVerifyServerCommand : ICommand
+    {
+        public class Configuration : ConfigurationBase
+        {
+            public Configuration(CommandLineOptions options)
+            {
+                this.Main = (args) => LockVerifyServer.Main(args);
+
+                this.Name = "verify-server";
+                this.Description = FromResource("Description");
+
+                this.Argument("<IP_HOSTNAME>", FromResource("IPHostnameDescription"));
+                this.Argument("<MAX_CLIENTS>", FromResource("MaxClientsDescription"));
+
+                this.OnExecute(() => new LockVerifyServerCommand().Run(this));
+            }
+        }
+
+        public int Run(ConfigurationBase cmd)
+        {
+            if (!cmd.ValidateArguments(2))
+            {
+                return 1;
+            }
+
+            cmd.Main(cmd.GetNonNullArguments());
+            return 0;
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/9e389540/src/tools/lucene-cli/lucene-cli.xproj
----------------------------------------------------------------------
diff --git a/src/tools/lucene-cli/lucene-cli.xproj b/src/tools/lucene-cli/lucene-cli.xproj
new file mode 100644
index 0000000..b9674c1
--- /dev/null
+++ b/src/tools/lucene-cli/lucene-cli.xproj
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <PropertyGroup>
+    <VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">14.0</VisualStudioVersion>
+    <VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
+  </PropertyGroup>
+  <Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.Props" Condition="'$(VSToolsPath)' != ''" />
+  <PropertyGroup Label="Globals">
+    <ProjectGuid>d5f3414e-e743-4dca-a50a-da3278a2ba2b</ProjectGuid>
+    <RootNamespace>Lucene.Net.Cli</RootNamespace>
+    <BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">.\obj</BaseIntermediateOutputPath>
+    <OutputPath Condition="'$(OutputPath)'=='' ">.\bin\</OutputPath>
+    <TargetFrameworkVersion>v4.5.1</TargetFrameworkVersion>
+  </PropertyGroup>
+  <PropertyGroup>
+    <SchemaVersion>2.0</SchemaVersion>
+  </PropertyGroup>
+  <Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.targets" Condition="'$(VSToolsPath)' != ''" />
+</Project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/9e389540/src/tools/lucene-cli/options/CrossCheckTermVectorsOption.cs
----------------------------------------------------------------------
diff --git a/src/tools/lucene-cli/options/CrossCheckTermVectorsOption.cs b/src/tools/lucene-cli/options/CrossCheckTermVectorsOption.cs
new file mode 100644
index 0000000..c050b74
--- /dev/null
+++ b/src/tools/lucene-cli/options/CrossCheckTermVectorsOption.cs
@@ -0,0 +1,31 @@
+using Lucene.Net.Cli.CommandLine;
+
+namespace Lucene.Net.Cli
+{
+    /*
+     * Licensed to the Apache Software Foundation (ASF) under one or more
+     * contributor license agreements.  See the NOTICE file distributed with
+     * this work for additional information regarding copyright ownership.
+     * The ASF licenses this file to You under the Apache License, Version 2.0
+     * (the "License"); you may not use this file except in compliance with
+     * the License.  You may obtain a copy of the License at
+     *
+     *     http://www.apache.org/licenses/LICENSE-2.0
+     *
+     * Unless required by applicable law or agreed to in writing, software
+     * distributed under the License is distributed on an "AS IS" BASIS,
+     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     * See the License for the specific language governing permissions and
+     * limitations under the License.
+     */
+
+    public class CrossCheckTermVectorsOption : CommandOption
+    {
+        public CrossCheckTermVectorsOption()
+            : base("-c|--cross-check-term-vectors", CommandOptionType.NoValue)
+        {
+            Description = Resources.Strings.CrossCheckTermVectorsDescription;
+        }
+
+    }
+}

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/9e389540/src/tools/lucene-cli/options/DirectoryTypeOption.cs
----------------------------------------------------------------------
diff --git a/src/tools/lucene-cli/options/DirectoryTypeOption.cs b/src/tools/lucene-cli/options/DirectoryTypeOption.cs
new file mode 100644
index 0000000..2fcdfa2
--- /dev/null
+++ b/src/tools/lucene-cli/options/DirectoryTypeOption.cs
@@ -0,0 +1,30 @@
+using Lucene.Net.Cli.CommandLine;
+
+namespace Lucene.Net.Cli
+{
+    /*
+     * Licensed to the Apache Software Foundation (ASF) under one or more
+     * contributor license agreements.  See the NOTICE file distributed with
+     * this work for additional information regarding copyright ownership.
+     * The ASF licenses this file to You under the Apache License, Version 2.0
+     * (the "License"); you may not use this file except in compliance with
+     * the License.  You may obtain a copy of the License at
+     *
+     *     http://www.apache.org/licenses/LICENSE-2.0
+     *
+     * Unless required by applicable law or agreed to in writing, software
+     * distributed under the License is distributed on an "AS IS" BASIS,
+     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     * See the License for the specific language governing permissions and
+     * limitations under the License.
+     */
+
+    public class DirectoryTypeOption : CommandOption
+    {
+        public DirectoryTypeOption()
+            : base("-dir|--directory-type <DIRECTORY_TYPE>", CommandOptionType.SingleValue)
+        {
+            Description = Resources.Strings.DirectoryTypeOptionDescription;
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/9e389540/src/tools/lucene-cli/options/SegmentOption.cs
----------------------------------------------------------------------
diff --git a/src/tools/lucene-cli/options/SegmentOption.cs b/src/tools/lucene-cli/options/SegmentOption.cs
new file mode 100644
index 0000000..0f164e7
--- /dev/null
+++ b/src/tools/lucene-cli/options/SegmentOption.cs
@@ -0,0 +1,31 @@
+using Lucene.Net.Cli.CommandLine;
+
+namespace Lucene.Net.Cli
+{
+    /*
+     * Licensed to the Apache Software Foundation (ASF) under one or more
+     * contributor license agreements.  See the NOTICE file distributed with
+     * this work for additional information regarding copyright ownership.
+     * The ASF licenses this file to You under the Apache License, Version 2.0
+     * (the "License"); you may not use this file except in compliance with
+     * the License.  You may obtain a copy of the License at
+     *
+     *     http://www.apache.org/licenses/LICENSE-2.0
+     *
+     * Unless required by applicable law or agreed to in writing, software
+     * distributed under the License is distributed on an "AS IS" BASIS,
+     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     * See the License for the specific language governing permissions and
+     * limitations under the License.
+     */
+
+    public class SegmentOption : CommandOption
+    {
+        public SegmentOption(bool allowMultiple = true)
+            : base("-s|--segment <SEGMENT>", allowMultiple ? CommandOptionType.MultipleValue : CommandOptionType.SingleValue)
+        {
+            Description = Resources.Strings.SegmentsOptionDescription + 
+                (allowMultiple ? " " + Resources.Strings.SegmentsOptionMultipleDescription : "");
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/9e389540/src/tools/lucene-cli/options/VerboseOption.cs
----------------------------------------------------------------------
diff --git a/src/tools/lucene-cli/options/VerboseOption.cs b/src/tools/lucene-cli/options/VerboseOption.cs
new file mode 100644
index 0000000..e151104
--- /dev/null
+++ b/src/tools/lucene-cli/options/VerboseOption.cs
@@ -0,0 +1,30 @@
+using Lucene.Net.Cli.CommandLine;
+
+namespace Lucene.Net.Cli
+{
+    /*
+     * Licensed to the Apache Software Foundation (ASF) under one or more
+     * contributor license agreements.  See the NOTICE file distributed with
+     * this work for additional information regarding copyright ownership.
+     * The ASF licenses this file to You under the Apache License, Version 2.0
+     * (the "License"); you may not use this file except in compliance with
+     * the License.  You may obtain a copy of the License at
+     *
+     *     http://www.apache.org/licenses/LICENSE-2.0
+     *
+     * Unless required by applicable law or agreed to in writing, software
+     * distributed under the License is distributed on an "AS IS" BASIS,
+     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     * See the License for the specific language governing permissions and
+     * limitations under the License.
+     */
+
+    public class VerboseOption : CommandOption
+    {
+        public VerboseOption()
+            : base("-v|--verbose", CommandOptionType.NoValue)
+        {
+            Description = Resources.Strings.VerboseOptionDescription;
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/9e389540/src/tools/lucene-cli/project.json
----------------------------------------------------------------------
diff --git a/src/tools/lucene-cli/project.json b/src/tools/lucene-cli/project.json
new file mode 100644
index 0000000..8c64570
--- /dev/null
+++ b/src/tools/lucene-cli/project.json
@@ -0,0 +1,39 @@
+{
+  "version": "4.8.0",
+  "entryPoint": "Program",
+  "buildOptions": {
+    "emitEntryPoint": true,
+    "compile": {
+      "includeFiles": [
+        "../../CommonAssemblyInfo.cs"
+      ]
+    },
+    "embed": {
+      "include": [
+        "../../Lucene.Net.Demo/*.cs",
+        "../../Lucene.Net.Demo/Facet/*.cs"
+      ]
+    }
+  },
+
+  "dependencies": {
+    "Lucene.Net": "4.8.0",
+    "Lucene.Net.Analysis.Common": "4.8.0",
+    "Lucene.Net.Analysis.Stempel": "4.8.0",
+    "Lucene.Net.Demo": "4.8.0",
+    "Lucene.Net.Expressions": "4.8.0",
+    "Lucene.Net.Facet": "4.8.0",
+    "Lucene.Net.Misc": "4.8.0",
+    "Lucene.Net.Tests.QueryParser": "4.8.0",
+    "Microsoft.NETCore.App": {
+      "type": "platform",
+      "version": "1.0.1"
+    }
+  },
+
+  "frameworks": {
+    "netcoreapp1.0": {
+      "imports": "dnxcore50"
+    }
+  }
+}


[19/22] lucenenet git commit: lucene-cli: fixed compiler warnings

Posted by ni...@apache.org.
lucene-cli: fixed compiler warnings


Project: http://git-wip-us.apache.org/repos/asf/lucenenet/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucenenet/commit/08197052
Tree: http://git-wip-us.apache.org/repos/asf/lucenenet/tree/08197052
Diff: http://git-wip-us.apache.org/repos/asf/lucenenet/diff/08197052

Branch: refs/heads/master
Commit: 08197052a83391fc64073d563ecc42f01eac4d05
Parents: d0e5d98
Author: Shad Storhaug <sh...@shadstorhaug.com>
Authored: Tue Jul 11 12:51:20 2017 +0700
Committer: Shad Storhaug <sh...@shadstorhaug.com>
Committed: Tue Jul 11 12:51:20 2017 +0700

----------------------------------------------------------------------
 src/tools/lucene-cli/ConfigurationBase.cs       | 2 +-
 src/tools/lucene-cli/SourceCode/ConsolePager.cs | 1 -
 2 files changed, 1 insertion(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucenenet/blob/08197052/src/tools/lucene-cli/ConfigurationBase.cs
----------------------------------------------------------------------
diff --git a/src/tools/lucene-cli/ConfigurationBase.cs b/src/tools/lucene-cli/ConfigurationBase.cs
index 28e8de5..5aacf4e 100644
--- a/src/tools/lucene-cli/ConfigurationBase.cs
+++ b/src/tools/lucene-cli/ConfigurationBase.cs
@@ -61,7 +61,7 @@ namespace Lucene.Net.Cli
                 {
                     return invoke();
                 }
-                catch (ArgumentException e)
+                catch (ArgumentException)
                 {
                     // Rather than writing to console, the
                     // utilities are now throwing ArgumentException

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/08197052/src/tools/lucene-cli/SourceCode/ConsolePager.cs
----------------------------------------------------------------------
diff --git a/src/tools/lucene-cli/SourceCode/ConsolePager.cs b/src/tools/lucene-cli/SourceCode/ConsolePager.cs
index 101935f..ef17101 100644
--- a/src/tools/lucene-cli/SourceCode/ConsolePager.cs
+++ b/src/tools/lucene-cli/SourceCode/ConsolePager.cs
@@ -54,7 +54,6 @@ namespace Lucene.Net.Cli.SourceCode
     public class ConsolePager : IDisposable
     {
         private readonly MultipleFileLineEnumerator enumerator;
-        private readonly IEnumerable<string> files;
 
         public ConsolePager(IEnumerable<string> files)
         {


[06/22] lucenenet git commit: Merge branch 'master' into cli

Posted by ni...@apache.org.
Merge branch 'master' into cli


Project: http://git-wip-us.apache.org/repos/asf/lucenenet/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucenenet/commit/a70144d8
Tree: http://git-wip-us.apache.org/repos/asf/lucenenet/tree/a70144d8
Diff: http://git-wip-us.apache.org/repos/asf/lucenenet/diff/a70144d8

Branch: refs/heads/master
Commit: a70144d8f219772eac0c3477a0c92bb80721b218
Parents: 9e38954 93f57ed
Author: Shad Storhaug <sh...@shadstorhaug.com>
Authored: Thu Jul 6 20:07:32 2017 +0700
Committer: Shad Storhaug <sh...@shadstorhaug.com>
Committed: Thu Jul 6 20:07:32 2017 +0700

----------------------------------------------------------------------
 build/build.ps1 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------



[09/22] lucenenet git commit: lucene-cli: Added Markdown documentation, and extended help text for many commands. Fixed IndexSplitCommand because MultiPassIndexSplitter doesn't make number of segments an optional argument.

Posted by ni...@apache.org.
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/70f15595/src/tools/lucene-cli/docs/index/list-term-info.md
----------------------------------------------------------------------
diff --git a/src/tools/lucene-cli/docs/index/list-term-info.md b/src/tools/lucene-cli/docs/index/list-term-info.md
new file mode 100644
index 0000000..61b97e2
--- /dev/null
+++ b/src/tools/lucene-cli/docs/index/list-term-info.md
@@ -0,0 +1,40 @@
+# list-term-info
+
+### Name
+
+`index-list-term-info` - Gets document frequency and total number of occurrences of a term.
+
+### Synopsis
+
+<code>dotnet lucene-cli.dll index list-term-info <INDEX_DIRECTORY> <FIELD> <TERM> [?|-h|--help]</code>
+
+### Description
+
+Gets document frequency and total number of occurrences (sum of the term frequency for each document) of a term.
+
+### Arguments
+
+`INDEX_DIRECTORY`
+
+The directory of the index.
+
+`FIELD`
+
+The field to consider.
+
+`TERM`
+
+The term to consider.
+
+### Options
+
+`?|-h|--help`
+
+Prints out a short help for the command.
+
+### Example
+
+List the term information from the index located at `C:\project-index\`:
+
+<code>dotnet lucene-cli.dll index list-term-info C:\project-index</code>
+

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/70f15595/src/tools/lucene-cli/docs/index/merge.md
----------------------------------------------------------------------
diff --git a/src/tools/lucene-cli/docs/index/merge.md b/src/tools/lucene-cli/docs/index/merge.md
new file mode 100644
index 0000000..98d296f
--- /dev/null
+++ b/src/tools/lucene-cli/docs/index/merge.md
@@ -0,0 +1,36 @@
+# merge
+
+### Name
+
+`index-merge` - Merges multiple indexes into a single index.
+
+### Synopsis
+
+<code>dotnet lucene-cli.dll index merge <OUTPUT_DIRECTORY> <INPUT_DIRECTORY> <INPUT_DIRECTORY_2>[ <INPUT_DIRECTORY_N>...] [?|-h|--help]</code>
+
+### Description
+
+Merges the the input index directories into a combined index at the output directory path.
+
+### Arguments
+
+`OUTPUT_DIRECTORY`
+
+The output directory to merge the input indexes into.
+
+`INPUT_DIRECTORY, INPUT_DIRECTORY_2, INPUT_DIRECTORY_N`
+
+Two or more input index directories, separated by a space.
+
+### Options
+
+`?|-h|--help`
+
+Prints out a short help for the command.
+
+### Example
+
+Merge the indexes `C:\product-index1` and `C:\product-index2` into an index located at `X:\merged-index`:
+
+<code>dotnet lucene-cli.dll index merge X:\merged-index C:\product-index1 C:\product-index2</code>
+

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/70f15595/src/tools/lucene-cli/docs/index/split.md
----------------------------------------------------------------------
diff --git a/src/tools/lucene-cli/docs/index/split.md b/src/tools/lucene-cli/docs/index/split.md
new file mode 100644
index 0000000..f2343d5
--- /dev/null
+++ b/src/tools/lucene-cli/docs/index/split.md
@@ -0,0 +1,54 @@
+# split
+
+### Name
+
+`index-split` - Splits an index into multiple equal parts.
+
+### Synopsis
+
+<code>dotnet lucene-cli.dll index split <OUTPUT_DIRECTORY> <INPUT_DIRECTORY>[ <INPUT_DIRECTORY_2>...] [-n|--number-of-parts] [-s|--sequential] [?|-h|--help]</code>
+
+### Description
+
+Splits the input index into multiple equal parts. The method employed here uses `IndexWriter.AddIndexes(IndexReader[])` where the input data comes from the input index with artificially applied deletes to the document ids that fall outside the selected partition.
+
+Deletes are only applied to a buffered list of deleted documents and don't affect the source index. This tool works also with read-only indexes.
+
+The disadvantage of this tool is that source index needs to be read as many times as there are parts to be created. The multiple passes may be slow.
+
+> **NOTE:** This tool is unaware of documents added automatically via `IndexWriter.AddDocuments(IEnumerable&lt;IEnumerable&lt;IIndexableField&gt;&gt;, Analyzer)` or `IndexWriter.UpdateDocuments(Term, IEnumerable&lt;IEnumerable&lt;IIndexableField&gt;&gt;, Analyzer)`, which means it can easily break up such document groups.
+
+### Arguments
+
+`OUTPUT_DIRECTORY`
+
+Path to output directory to contain partial indexes.
+
+`INPUT_DIRECTORY, INPUT_DIRECTORY_2`
+
+The path of the source index, which can have deletions and can have multiple segments (or multiple readers). Multiple values can be supplied separated by a space.
+
+### Options
+
+`?|-h|--help`
+
+Prints out a short help for the command.
+
+`-n|--number-of-parts <NUMBER>`
+
+The number of parts (output indices) to produce. If omitted, defaults to 2.
+
+`-s|--sequential`
+
+Sequential doc-id range split (default is round-robin).
+
+### Example
+
+Split the index located at `X:\old-index\` sequentially, placing the resulting 2 indices into the `X:\new-index\` directory:
+
+<code>dotnet lucene-cli.dll index split X:\new-index X:\old-index --sequential</code>
+
+
+Split the index located at `T:\in\` into 4 parts and place them into the `T:\out\` directory:
+
+<code>dotnet lucene-cli.dll index split T:\out T:\in -n 4</code>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/70f15595/src/tools/lucene-cli/docs/index/upgrade.md
----------------------------------------------------------------------
diff --git a/src/tools/lucene-cli/docs/index/upgrade.md b/src/tools/lucene-cli/docs/index/upgrade.md
new file mode 100644
index 0000000..20f5861
--- /dev/null
+++ b/src/tools/lucene-cli/docs/index/upgrade.md
@@ -0,0 +1,52 @@
+# upgrade
+
+### Name
+
+`index-upgrade` - Upgrades all segments of an index from previous Lucene.Net versions to the current segment file format.
+
+### Synopsis
+
+<code>dotnet lucene-cli.dll index upgrade [<INDEX_DIRECTORY>] [-d|--delete-prior-commits] [-v|--verbose] [-dir|--directory-type] [?|-h|--help]</code>
+
+### Description
+
+This tool keeps only the last commit in an index; for this reason, if the incoming index has more than one commit, the tool refuses to run by default. Specify --delete-prior-commits to override this, allowing the tool to delete all but the last commit. 
+
+Specify an FSDirectory implementation through the --directory-type option to force its use. If not qualified by an AssemblyName, the Lucene.Net.dll assembly will be used. 
+
+> **WARNING:** This tool may reorder document IDs! Be sure to make a backup of your index before you use this. Also, ensure you are using the correct version of this utility to match your application's version of Lucene.Net. This operation cannot be reversed.
+
+### Arguments
+
+`INDEX_DIRECTORY`
+
+The directory of the index. If omitted, it defaults to the current working directory.
+
+### Options
+
+`?|-h|--help`
+
+Prints out a short help for the command.
+
+`-d|--delete-prior-commits`
+
+Deletes prior commits.
+
+`-v|--verbose`
+
+Verbose output.
+
+`-dir|--directory-type <DIRECTORY_TYPE>`
+
+The `FSDirectory` implementation to use. Defaults to the optional `FSDirectory` for your OS platform.
+
+### Examples
+
+Upgrade the index format of the index located at `X:\lucene-index\` to the same version as this tool, using the `SimpleFSDirectory` implementation:
+
+<code>dotnet lucene-cli.dll index upgrade X:\lucene-index -dir SimpleFSDirectory</code>
+
+
+Upgrade the index located at `C:\indexes\category-index\` verbosely, deleting all but the last commit:
+
+<code>dotnet lucene-cli.dll index upgrade C:\indexes\category-index --verbose --delete-prior-commits</code>

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/70f15595/src/tools/lucene-cli/docs/lock/index.md
----------------------------------------------------------------------
diff --git a/src/tools/lucene-cli/docs/lock/index.md b/src/tools/lucene-cli/docs/lock/index.md
new file mode 100644
index 0000000..f093377
--- /dev/null
+++ b/src/tools/lucene-cli/docs/lock/index.md
@@ -0,0 +1,10 @@
+# lock
+
+## Description
+
+Utilities for verifying concurrent locking integrity.
+
+## Commands
+
+- [stress-test](stress-test.md)
+- [verify-server](verify-server.md)
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/70f15595/src/tools/lucene-cli/docs/lock/stress-test.md
----------------------------------------------------------------------
diff --git a/src/tools/lucene-cli/docs/lock/stress-test.md b/src/tools/lucene-cli/docs/lock/stress-test.md
new file mode 100644
index 0000000..b1d49a5
--- /dev/null
+++ b/src/tools/lucene-cli/docs/lock/stress-test.md
@@ -0,0 +1,55 @@
+# stress-test
+
+### Name
+
+`lock-stress-test` - Simple tool that forever acquires and releases a lock using a specific `LockFactory`.
+
+### Synopsis
+
+<code>dotnet lucene-cli.dll lock stress-test <ID> <VERIFIER_HOST> <VERIFIER_PORT> <LOCK_FACTORY_TYPE> <LOCK_DIRECTORY> <SLEEP_TIME_MS> <TRIES> [?|-h|--help]</code>
+
+### Description
+
+You should run multiple instances of this process, each with its own unique ID, and each pointing to the same lock directory, to verify that locking is working correctly. Make sure you are first running [verify-server](verify-server.md).
+
+### Arguments
+
+`ID`
+
+An integer from 0 - 255 (should be unique for test process).
+
+`VERIFIER_HOST`
+
+Hostname or IP address that [verify-server](verify-server.md) is listening on.
+
+`VERIFIER_PORT`
+
+Port that [verify-server](verify-server.md) is listening on.
+
+`LOCK_FACTORY_TYPE`
+
+The primary LockFactory implementation that we will use.
+
+`LOCK_DIRECTORY`
+
+The path to the lock directory (only utilized if `LOCK_FACTORY_TYPE` is set to `SimpleFSLockFactory` or `NativeFSLockFactory`).
+
+`SLEEP_TIME_MS`
+
+Milliseconds to pause between each lock obtain/release.
+
+`TRIES`
+
+Number of locking tries.
+
+### Options
+
+`?|-h|--help`
+
+Prints out a short help for the command.
+
+### Example
+
+Run the client (stress test), connecting to the server on IP address `127.0.0.4` and port `54464` using the ID 3, the `NativeFSLockFactory`, specifying the lock directory as `F:\temp`, sleep for 50 milliseconds, and try to obtain a lock up to 10 times:
+
+<code>dotnet lucene-cli.dll lock stress-test 3 127.0.0.4 54464 NativeFSLockFactory F:\temp 50 10</code>

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/70f15595/src/tools/lucene-cli/docs/lock/verify-server.md
----------------------------------------------------------------------
diff --git a/src/tools/lucene-cli/docs/lock/verify-server.md b/src/tools/lucene-cli/docs/lock/verify-server.md
new file mode 100644
index 0000000..a34dce1
--- /dev/null
+++ b/src/tools/lucene-cli/docs/lock/verify-server.md
@@ -0,0 +1,35 @@
+# verify-server
+
+### Name
+
+`lock-verify-server` - Server that must be running when you use VerifyingLockFactory (or [stress-test](stress-test.md)).
+
+### Synopsis
+
+<code>dotnet lucene-cli.dll lock verify-server <IP_HOSTNAME> <MAX_CLIENTS> [?|-h|--help]</code>
+
+### Description
+
+This server simply verifies that at most one process holds the lock at a time.
+
+### Arguments
+
+`IP_HOSTNAME`
+
+Hostname or IP address that [verify-server](verify-server.md) will listen on.
+
+`MAX_CLIENTS`
+
+The maximum number of connected clients.
+
+### Options
+
+`?|-h|--help`
+
+Prints out a short help for the command.
+
+### Example
+
+Run the server on IP `127.0.0.4` with a maximum of 100 connected clients allowed:
+
+<code>dotnet lucene-cli.dll lock verify-server 127.0.0.4 100</code>


[20/22] lucenenet git commit: Lucene.Net.Tests.Facet: Fixed name of assembly

Posted by ni...@apache.org.
Lucene.Net.Tests.Facet: Fixed name of assembly


Project: http://git-wip-us.apache.org/repos/asf/lucenenet/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucenenet/commit/c487bbc6
Tree: http://git-wip-us.apache.org/repos/asf/lucenenet/tree/c487bbc6
Diff: http://git-wip-us.apache.org/repos/asf/lucenenet/diff/c487bbc6

Branch: refs/heads/master
Commit: c487bbc6d0996f37f55ee8a62d01569f861c1b90
Parents: 0819705
Author: Shad Storhaug <sh...@shadstorhaug.com>
Authored: Tue Jul 11 12:52:20 2017 +0700
Committer: Shad Storhaug <sh...@shadstorhaug.com>
Committed: Tue Jul 11 12:52:20 2017 +0700

----------------------------------------------------------------------
 src/Lucene.Net.Tests.Facet/Properties/AssemblyInfo.cs | 2 +-
 src/Lucene.Net.Tests.Facet/project.json               | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c487bbc6/src/Lucene.Net.Tests.Facet/Properties/AssemblyInfo.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Facet/Properties/AssemblyInfo.cs b/src/Lucene.Net.Tests.Facet/Properties/AssemblyInfo.cs
index 88f48a9..0632527 100644
--- a/src/Lucene.Net.Tests.Facet/Properties/AssemblyInfo.cs
+++ b/src/Lucene.Net.Tests.Facet/Properties/AssemblyInfo.cs
@@ -26,7 +26,7 @@ using System.Runtime.InteropServices;
 // General Information about an assembly is controlled through the following 
 // set of attributes. Change these attribute values to modify the information
 // associated with an assembly.
-[assembly: AssemblyTitle("Lucene.Net.Tests.Classification")]
+[assembly: AssemblyTitle("Lucene.Net.Tests.Facet")]
 [assembly: AssemblyDescription("")]
 [assembly: AssemblyConfiguration("")]
 [assembly: AssemblyCulture("")]

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c487bbc6/src/Lucene.Net.Tests.Facet/project.json
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Facet/project.json b/src/Lucene.Net.Tests.Facet/project.json
index ebfa125..cb55b9a 100644
--- a/src/Lucene.Net.Tests.Facet/project.json
+++ b/src/Lucene.Net.Tests.Facet/project.json
@@ -1,6 +1,6 @@
 {
   "version": "4.8.0",
-  "title": "Lucene.Net.Tests.Classification",
+  "title": "Lucene.Net.Tests.Facet",
   "buildOptions": {
     "compile": {
       "includeFiles": [ "../CommonAssemblyInfo.cs" ]


[12/22] lucenenet git commit: lucene-cli: added integration tests for the IndexUpgradeCommand

Posted by ni...@apache.org.
lucene-cli: added integration tests for the IndexUpgradeCommand


Project: http://git-wip-us.apache.org/repos/asf/lucenenet/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucenenet/commit/92db055e
Tree: http://git-wip-us.apache.org/repos/asf/lucenenet/tree/92db055e
Diff: http://git-wip-us.apache.org/repos/asf/lucenenet/diff/92db055e

Branch: refs/heads/master
Commit: 92db055eae0fa42ebbea1f00a46d3cefb3e7980d
Parents: faa85eb
Author: Shad Storhaug <sh...@shadstorhaug.com>
Authored: Mon Jul 10 18:05:57 2017 +0700
Committer: Shad Storhaug <sh...@shadstorhaug.com>
Committed: Mon Jul 10 18:05:57 2017 +0700

----------------------------------------------------------------------
 src/Lucene.Net/Index/IndexUpgrader.cs           |  6 +-
 src/Lucene.Net/Properties/AssemblyInfo.cs       |  1 +
 .../Commands/CommandTestCase.cs                 | 27 ++++---
 .../Commands/Index/IndexUpgradeCommandTest.cs   | 77 ++++++++++++++++++++
 .../index/index-upgrade/IndexUpgradeCommand.cs  |  3 +-
 5 files changed, 97 insertions(+), 17 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucenenet/blob/92db055e/src/Lucene.Net/Index/IndexUpgrader.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net/Index/IndexUpgrader.cs b/src/Lucene.Net/Index/IndexUpgrader.cs
index 9898fea..8cae11f 100644
--- a/src/Lucene.Net/Index/IndexUpgrader.cs
+++ b/src/Lucene.Net/Index/IndexUpgrader.cs
@@ -136,9 +136,9 @@ namespace Lucene.Net.Index
 #pragma warning restore 612, 618
         }
 
-        private readonly Directory dir;
-        private readonly IndexWriterConfig iwc;
-        private readonly bool deletePriorCommits;
+        internal readonly Directory dir; // LUCENENET specific - made internal for testing CLI arguments
+        internal readonly IndexWriterConfig iwc; // LUCENENET specific - made internal for testing CLI arguments
+        internal readonly bool deletePriorCommits; // LUCENENET specific - made internal for testing CLI arguments
 
         /// <summary>
         /// Creates index upgrader on the given directory, using an <see cref="IndexWriter"/> using the given

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/92db055e/src/Lucene.Net/Properties/AssemblyInfo.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net/Properties/AssemblyInfo.cs b/src/Lucene.Net/Properties/AssemblyInfo.cs
index 68b5b85..948bc8f 100644
--- a/src/Lucene.Net/Properties/AssemblyInfo.cs
+++ b/src/Lucene.Net/Properties/AssemblyInfo.cs
@@ -63,6 +63,7 @@ using System.Runtime.CompilerServices;
 [assembly: InternalsVisibleTo("Lucene.Net.Tests.ICU")] // For Analysis.Util.TestSegmentingTokenizerBase
 [assembly: InternalsVisibleTo("Lucene.Net.Tests.Misc")]
 [assembly: InternalsVisibleTo("Lucene.Net.Tests.QueryParser")]
+[assembly: InternalsVisibleTo("Lucene.Net.Tests.Cli")] // For lucene-cli
 
 // NOTE: Version information is in CommonAssemblyInfo.cs
 

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/92db055e/src/tools/Lucene.Net.Tests.Cli/Commands/CommandTestCase.cs
----------------------------------------------------------------------
diff --git a/src/tools/Lucene.Net.Tests.Cli/Commands/CommandTestCase.cs b/src/tools/Lucene.Net.Tests.Cli/Commands/CommandTestCase.cs
index 7d933d7..9174667 100644
--- a/src/tools/Lucene.Net.Tests.Cli/Commands/CommandTestCase.cs
+++ b/src/tools/Lucene.Net.Tests.Cli/Commands/CommandTestCase.cs
@@ -1,4 +1,5 @@
-using NUnit.Framework;
+using Lucene.Net.Util;
+using NUnit.Framework;
 using System.Collections.Generic;
 using System.IO;
 using System.Linq;
@@ -23,18 +24,8 @@ namespace Lucene.Net.Cli.Commands
      */
 
     // LUCENENET TODO: Move to TestFramework ?
-    public abstract class CommandTestCase
+    public abstract class CommandTestCase : LuceneTestCase
     {
-        [SetUp]
-        protected virtual void SetUp()
-        {
-        }
-
-        [TearDown]
-        protected virtual void TearDown()
-        {
-        }
-
         protected abstract ConfigurationBase CreateConfiguration(MockConsoleApp app);
 
         protected abstract IList<Arg[]> GetRequiredArgs();
@@ -142,6 +133,18 @@ namespace Lucene.Net.Cli.Commands
             }
         }
 
+        /// <summary>
+        /// Runs a command against the current command configuration
+        /// </summary>
+        /// <param name="command">A command as a string that will be parsed.</param>
+        /// <returns>A MockConsoleApp that can be used to inspect the number of calls and arguments that will be passed to the Lucene CLI tool.</returns>
+        public virtual MockConsoleApp RunCommand(string command)
+        {
+            var output = new MockConsoleApp();
+            var cmd = CreateConfiguration(output).Execute(command.ToArgs());
+            return output;
+        }
+
         public class MockConsoleApp
         {
             public void Main(string[] args)

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/92db055e/src/tools/Lucene.Net.Tests.Cli/Commands/Index/IndexUpgradeCommandTest.cs
----------------------------------------------------------------------
diff --git a/src/tools/Lucene.Net.Tests.Cli/Commands/Index/IndexUpgradeCommandTest.cs b/src/tools/Lucene.Net.Tests.Cli/Commands/Index/IndexUpgradeCommandTest.cs
index 776c3d4..547fbab 100644
--- a/src/tools/Lucene.Net.Tests.Cli/Commands/Index/IndexUpgradeCommandTest.cs
+++ b/src/tools/Lucene.Net.Tests.Cli/Commands/Index/IndexUpgradeCommandTest.cs
@@ -1,4 +1,6 @@
 using Lucene.Net.Cli.CommandLine;
+using Lucene.Net.Index;
+using Lucene.Net.Store;
 using NUnit.Framework;
 using System.Collections.Generic;
 
@@ -63,5 +65,80 @@ namespace Lucene.Net.Cli.Commands
         {
             Assert.Throws<CommandParsingException>(() => AssertConsoleOutput("one two", ""));
         }
+
+        /// <summary>
+        /// Integration test to ensure --verbose argument is passed through and parsed correctly by IndexUpgrader
+        /// </summary>
+        [Test]
+        public virtual void TestPassingVerboseArgument()
+        {
+            MockConsoleApp output;
+            IndexUpgrader upgrader;
+
+            output = RunCommand(@"C:\test-index");
+            upgrader = IndexUpgrader.ParseArgs(output.Args);
+            Assert.AreSame(Util.InfoStream.Default, upgrader.iwc.InfoStream);
+
+            output = RunCommand(@"C:\test-index -v");
+            upgrader = IndexUpgrader.ParseArgs(output.Args);
+            Assert.AreNotSame(Util.InfoStream.Default, upgrader.iwc.InfoStream);
+
+            output = RunCommand(@"C:\test-index --verbose");
+            upgrader = IndexUpgrader.ParseArgs(output.Args);
+            Assert.AreNotSame(Util.InfoStream.Default, upgrader.iwc.InfoStream);
+        }
+
+        /// <summary>
+        /// Integration test to ensure --delete-prior-commits argument is passed through and parsed correctly by IndexUpgrader
+        /// </summary>
+        [Test]
+        public virtual void TestPassingDeletePriorCommitsArgument()
+        {
+            MockConsoleApp output;
+            IndexUpgrader upgrader;
+
+            output = RunCommand(@"C:\test-index");
+            upgrader = IndexUpgrader.ParseArgs(output.Args);
+            Assert.IsFalse(upgrader.deletePriorCommits);
+
+            output = RunCommand(@"C:\test-index -d");
+            upgrader = IndexUpgrader.ParseArgs(output.Args);
+            Assert.IsTrue(upgrader.deletePriorCommits);
+
+            output = RunCommand(@"C:\test-index --delete-prior-commits");
+            upgrader = IndexUpgrader.ParseArgs(output.Args);
+            Assert.IsTrue(upgrader.deletePriorCommits);
+        }
+
+        /// <summary>
+        /// Integration test to ensure --directory-type argument is passed through and parsed correctly by IndexUpgrader
+        /// </summary>
+        [Test]
+        public virtual void TestPassingDirectoryTypeArgument()
+        {
+            MockConsoleApp output;
+            IndexUpgrader upgrader;
+            var tempDir = CreateTempDir("index-upgrader");
+
+            output = RunCommand(@"C:\test-index");
+            upgrader = IndexUpgrader.ParseArgs(output.Args);
+            Assert.AreEqual(FSDirectory.Open(tempDir).GetType(), upgrader.dir.GetType());
+
+            output = RunCommand(@"C:\test-index -dir SimpleFSDirectory");
+            upgrader = IndexUpgrader.ParseArgs(output.Args);
+            Assert.AreEqual(typeof(SimpleFSDirectory), upgrader.dir.GetType());
+
+            output = RunCommand(@"C:\test-index --directory-type SimpleFSDirectory");
+            upgrader = IndexUpgrader.ParseArgs(output.Args);
+            Assert.AreEqual(typeof(SimpleFSDirectory), upgrader.dir.GetType());
+
+            output = RunCommand(@"C:\test-index -dir MMapDirectory");
+            upgrader = IndexUpgrader.ParseArgs(output.Args);
+            Assert.AreEqual(typeof(MMapDirectory), upgrader.dir.GetType());
+
+            output = RunCommand(@"C:\test-index --directory-type MMapDirectory");
+            upgrader = IndexUpgrader.ParseArgs(output.Args);
+            Assert.AreEqual(typeof(MMapDirectory), upgrader.dir.GetType());
+        }
     }
 }

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/92db055e/src/tools/lucene-cli/commands/index/index-upgrade/IndexUpgradeCommand.cs
----------------------------------------------------------------------
diff --git a/src/tools/lucene-cli/commands/index/index-upgrade/IndexUpgradeCommand.cs b/src/tools/lucene-cli/commands/index/index-upgrade/IndexUpgradeCommand.cs
index f849bb5..eadcc72 100644
--- a/src/tools/lucene-cli/commands/index/index-upgrade/IndexUpgradeCommand.cs
+++ b/src/tools/lucene-cli/commands/index/index-upgrade/IndexUpgradeCommand.cs
@@ -31,6 +31,7 @@ namespace Lucene.Net.Cli
 
                 this.Name = "upgrade";
                 this.Description = FromResource("Description");
+                this.ExtendedHelpText = FromResource("ExtendedHelpText");
 
                 this.Arguments.Add(new IndexDirectoryArgument());
                 this.DeletePriorCommitsOption = this.Option("-d|--delete-prior-commits",
@@ -39,8 +40,6 @@ namespace Lucene.Net.Cli
                 this.Options.Add(new VerboseOption());
                 this.Options.Add(new DirectoryTypeOption());
                 
-                this.ExtendedHelpText = FromResource("ExtendedHelpText");
-
                 this.OnExecute(() => new IndexUpgradeCommand().Run(this));
             }
 


[08/22] lucenenet git commit: lucene-ci: Added additional tests and fixed bugs

Posted by ni...@apache.org.
lucene-ci: Added additional tests and fixed bugs


Project: http://git-wip-us.apache.org/repos/asf/lucenenet/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucenenet/commit/ea6ec0fa
Tree: http://git-wip-us.apache.org/repos/asf/lucenenet/tree/ea6ec0fa
Diff: http://git-wip-us.apache.org/repos/asf/lucenenet/diff/ea6ec0fa

Branch: refs/heads/master
Commit: ea6ec0fa629d8b6899819e395da66a813ed8a6e0
Parents: 3d11d5d
Author: Shad Storhaug <sh...@shadstorhaug.com>
Authored: Sat Jul 8 12:47:37 2017 +0700
Committer: Shad Storhaug <sh...@shadstorhaug.com>
Committed: Sat Jul 8 12:47:37 2017 +0700

----------------------------------------------------------------------
 .../Commands/Analysis/AnalysisCommandTest.cs    |  2 +-
 .../AnalysisStempelCompileStemsCommandTest.cs   |  3 +-
 .../AnalysisStempelPatchStemsCommandTest.cs     |  3 +-
 .../Commands/CommandTestCase.cs                 | 81 ++++++++++----------
 .../Demo/DemoAssociationsFacetsCommandTest.cs   | 40 ++++++++++
 .../Commands/Demo/DemoCommandTest.cs            |  2 +-
 .../Demo/DemoDistanceFacetsCommandTest.cs       | 41 ++++++++++
 ...emoExpressionAggregationFacetsCommandTest.cs | 42 ++++++++++
 .../Commands/Demo/DemoIndexFilesCommandTest.cs  | 61 +++++++++++++++
 .../DemoMultiCategoryListsFacetsCommandTest.cs  | 40 ++++++++++
 .../Commands/Demo/DemoRangeFacetsCommandTest.cs | 40 ++++++++++
 .../Commands/Demo/DemoSearchFilesCommandTest.cs | 64 ++++++++++++++++
 .../Demo/DemoSimpleFacetsCommandTest.cs         | 40 ++++++++++
 .../DemoSimpleSortedSetFacetsCommandTest.cs     | 40 ++++++++++
 .../Commands/Index/IndexCheckCommandTest.cs     | 47 +-----------
 .../Commands/Index/IndexCommandTest.cs          |  4 +-
 .../Commands/Index/IndexCopySegmentsTest.cs     |  3 +-
 .../Index/IndexDeleteSegmentsCommandTest.cs     |  3 +-
 .../Index/IndexExtractCfsCommandTest.cs         |  3 +-
 .../Commands/Index/IndexFixCommandTest.cs       | 46 ++++++++---
 .../Commands/Index/IndexListCfsCommandTest.cs   | 13 +---
 .../Index/IndexListHighFreqTermsCommandTest.cs  |  4 +-
 .../Index/IndexListSegmentsCommandTest.cs       |  4 +-
 .../Index/IndexListTaxonomyStatsCommandTest.cs  |  4 +-
 .../Index/IndexListTermInfoCommandTest.cs       |  5 +-
 .../Commands/Index/IndexMergeCommandTest.cs     |  3 +-
 .../Commands/Index/IndexSplitCommandTest.cs     |  3 +-
 .../Commands/Index/IndexUpgradeCommandTest.cs   |  4 +-
 .../Commands/Lock/LockCommandTest.cs            |  4 +-
 .../Commands/Lock/LockStressTestCommandTest.cs  |  5 +-
 .../Lock/LockVerifyServerCommandTest.cs         |  5 +-
 .../Commands/RootCommandTest.cs                 |  8 +-
 .../EnumerableExtensions.cs                     | 36 ++++++++-
 .../Lucene.Net.Tests.Cli/EnvironmentTest.cs     | 20 +++++
 .../Lucene.Net.Tests.Cli/StringExtensions.cs    | 36 ---------
 src/tools/lucene-cli/Properties/AssemblyInfo.cs |  2 +-
 .../lucene-cli/Resources/Strings.Designer.cs    | 36 ++++++---
 src/tools/lucene-cli/Resources/Strings.resx     | 20 +++--
 .../AnalysisStempelPatchStemsCommand.cs         |  5 +-
 .../demo-search-files/DemoSearchFilesCommand.cs |  3 +-
 .../index-extract-cfs/IndexExtractCfsCommand.cs |  2 +-
 .../commands/index/index-fix/IndexFixCommand.cs | 27 +++++--
 .../IndexListTaxonomyStatsCommand.cs            |  2 +-
 43 files changed, 646 insertions(+), 210 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucenenet/blob/ea6ec0fa/src/tools/Lucene.Net.Tests.Cli/Commands/Analysis/AnalysisCommandTest.cs
----------------------------------------------------------------------
diff --git a/src/tools/Lucene.Net.Tests.Cli/Commands/Analysis/AnalysisCommandTest.cs b/src/tools/Lucene.Net.Tests.Cli/Commands/Analysis/AnalysisCommandTest.cs
index d05131b..b0082e5 100644
--- a/src/tools/Lucene.Net.Tests.Cli/Commands/Analysis/AnalysisCommandTest.cs
+++ b/src/tools/Lucene.Net.Tests.Cli/Commands/Analysis/AnalysisCommandTest.cs
@@ -40,7 +40,7 @@ namespace Lucene.Net.Cli.Commands
         }
 
         [Test]
-        public void TestTooManyArguments()
+        public virtual void TestTooManyArguments()
         {
             Assert.Throws<CommandParsingException>(() => AssertConsoleOutput("one", ""));
         }

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/ea6ec0fa/src/tools/Lucene.Net.Tests.Cli/Commands/Analysis/AnalysisStempelCompileStemsCommandTest.cs
----------------------------------------------------------------------
diff --git a/src/tools/Lucene.Net.Tests.Cli/Commands/Analysis/AnalysisStempelCompileStemsCommandTest.cs b/src/tools/Lucene.Net.Tests.Cli/Commands/Analysis/AnalysisStempelCompileStemsCommandTest.cs
index 951644f..fdcae26 100644
--- a/src/tools/Lucene.Net.Tests.Cli/Commands/Analysis/AnalysisStempelCompileStemsCommandTest.cs
+++ b/src/tools/Lucene.Net.Tests.Cli/Commands/Analysis/AnalysisStempelCompileStemsCommandTest.cs
@@ -49,9 +49,8 @@ namespace Lucene.Net.Cli.Commands
         }
 
         [Test]
-        public void TestNotEnoughArguments()
+        public virtual void TestNotEnoughArguments()
         {
-            Assert.NotNull(FromResource("NotEnoughArguments"));
             AssertConsoleOutput("one", FromResource("NotEnoughArguments", 2));
         }
     }

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/ea6ec0fa/src/tools/Lucene.Net.Tests.Cli/Commands/Analysis/AnalysisStempelPatchStemsCommandTest.cs
----------------------------------------------------------------------
diff --git a/src/tools/Lucene.Net.Tests.Cli/Commands/Analysis/AnalysisStempelPatchStemsCommandTest.cs b/src/tools/Lucene.Net.Tests.Cli/Commands/Analysis/AnalysisStempelPatchStemsCommandTest.cs
index 0a21a1f..41d6637 100644
--- a/src/tools/Lucene.Net.Tests.Cli/Commands/Analysis/AnalysisStempelPatchStemsCommandTest.cs
+++ b/src/tools/Lucene.Net.Tests.Cli/Commands/Analysis/AnalysisStempelPatchStemsCommandTest.cs
@@ -48,9 +48,8 @@ namespace Lucene.Net.Cli.Commands.Analysis
         }
 
         [Test]
-        public void TestNotEnoughArguments()
+        public virtual void TestNotEnoughArguments()
         {
-            Assert.NotNull(FromResource("NotEnoughArguments"));
             AssertConsoleOutput("", FromResource("NotEnoughArguments", 1));
         }
     }

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/ea6ec0fa/src/tools/Lucene.Net.Tests.Cli/Commands/CommandTestCase.cs
----------------------------------------------------------------------
diff --git a/src/tools/Lucene.Net.Tests.Cli/Commands/CommandTestCase.cs b/src/tools/Lucene.Net.Tests.Cli/Commands/CommandTestCase.cs
index 0b1917d..7d933d7 100644
--- a/src/tools/Lucene.Net.Tests.Cli/Commands/CommandTestCase.cs
+++ b/src/tools/Lucene.Net.Tests.Cli/Commands/CommandTestCase.cs
@@ -46,6 +46,9 @@ namespace Lucene.Net.Cli.Commands
             var cmd = CreateConfiguration(output);
             cmd.Execute(command.ToArgs());
 
+            Assert.False(output.CallCount < 1, "Main() method not called");
+            Assert.False(output.CallCount > 1, "Main() method called more than once");
+
             Assert.AreEqual(expectedResult.Length, output.Args.Length);
             for (int i = 0; i < output.Args.Length; i++)
             {
@@ -66,12 +69,12 @@ namespace Lucene.Net.Cli.Commands
             Assert.True(consoleText.Contains(expectedConsoleText), "Expected output was {0}, actual console output was {1}", expectedConsoleText, consoleText);
         }
 
-        protected virtual string FromResource(string resourceName)
+        public static string FromResource(string resourceName)
         {
             return Resources.Strings.ResourceManager.GetString(resourceName);
         }
 
-        protected virtual string FromResource(string resourceName, params object[] args)
+        public static string FromResource(string resourceName, params object[] args)
         {
             return string.Format(Resources.Strings.ResourceManager.GetString(resourceName), args);
         }
@@ -106,14 +109,49 @@ namespace Lucene.Net.Cli.Commands
             AssertConsoleOutput("?", "Version");
         }
 
+        [Test]
+        public virtual void TestCommandHasDescription()
+        {
+            var output = new MockConsoleApp();
+            var cmd = CreateConfiguration(output);
+            Assert.IsNotNull(cmd.Description);
+            Assert.IsNotEmpty(cmd.Description);
+        }
+
+        [Test]
+        public virtual void TestAllArgumentsHaveDescription()
+        {
+            var output = new MockConsoleApp();
+            var cmd = CreateConfiguration(output);
+            foreach (var arg in cmd.Arguments)
+            {
+                Assert.IsNotNull(arg.Description);
+                Assert.IsNotEmpty(arg.Description);
+            }
+        }
+
+        [Test]
+        public virtual void TestAllOptionsHaveDescription()
+        {
+            var output = new MockConsoleApp();
+            var cmd = CreateConfiguration(output);
+            foreach (var option in cmd.Options)
+            {
+                Assert.IsNotNull(option.Description);
+                Assert.IsNotEmpty(option.Description);
+            }
+        }
+
         public class MockConsoleApp
         {
             public void Main(string[] args)
             {
                 this.Args = args;
+                this.CallCount++;
             }
 
             public string[] Args { get; private set; }
+            public int CallCount { get; private set; }
         }
 
         public class Arg
@@ -128,43 +166,4 @@ namespace Lucene.Net.Cli.Commands
             public string[] Output { get; private set; }
         }
     }
-
-    public static class ListExtensions
-    {
-        // Breaks out any options based on logical OR | symbol
-        public static IList<CommandTestCase.Arg[]> ExpandArgs(this IList<CommandTestCase.Arg[]> args)
-        {
-            var result = new List<CommandTestCase.Arg[]>();
-            foreach (var arg in args)
-            {
-                result.Add(ExpandArgs(arg));
-            }
-
-            return result;
-        }
-
-        public static CommandTestCase.Arg[] ExpandArgs(this CommandTestCase.Arg[] args)
-        {
-            var result = new List<CommandTestCase.Arg>();
-            if (args != null)
-            {
-                foreach (var arg in args)
-                {
-                    if (arg.InputPattern.Contains("|"))
-                    {
-                        var options = arg.InputPattern.Split('|');
-                        foreach (var option in options)
-                        {
-                            result.Add(new CommandTestCase.Arg(option, (string[])arg.Output.Clone()));
-                        }
-                    }
-                    else
-                    {
-                        result.Add(arg);
-                    }
-                }
-            }
-            return result.ToArray();
-        }
-    }
 }

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/ea6ec0fa/src/tools/Lucene.Net.Tests.Cli/Commands/Demo/DemoAssociationsFacetsCommandTest.cs
----------------------------------------------------------------------
diff --git a/src/tools/Lucene.Net.Tests.Cli/Commands/Demo/DemoAssociationsFacetsCommandTest.cs b/src/tools/Lucene.Net.Tests.Cli/Commands/Demo/DemoAssociationsFacetsCommandTest.cs
new file mode 100644
index 0000000..8bb7c94
--- /dev/null
+++ b/src/tools/Lucene.Net.Tests.Cli/Commands/Demo/DemoAssociationsFacetsCommandTest.cs
@@ -0,0 +1,40 @@
+using System.Collections.Generic;
+
+namespace Lucene.Net.Cli.Commands.Demo
+{
+    /*
+     * Licensed to the Apache Software Foundation (ASF) under one or more
+     * contributor license agreements.  See the NOTICE file distributed with
+     * this work for additional information regarding copyright ownership.
+     * The ASF licenses this file to You under the Apache License, Version 2.0
+     * (the "License"); you may not use this file except in compliance with
+     * the License.  You may obtain a copy of the License at
+     *
+     *     http://www.apache.org/licenses/LICENSE-2.0
+     *
+     * Unless required by applicable law or agreed to in writing, software
+     * distributed under the License is distributed on an "AS IS" BASIS,
+     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     * See the License for the specific language governing permissions and
+     * limitations under the License.
+     */
+
+    public class DemoAssociationsFacetsCommandTest : CommandTestCase
+    {
+        protected override ConfigurationBase CreateConfiguration(MockConsoleApp app)
+        {
+            return new DemoAssociationsFacetsCommand.Configuration(new CommandLineOptions()) { Main = (args) => app.Main(args) };
+        }
+
+        protected override IList<Arg[]> GetOptionalArgs()
+        {
+            return new List<Arg[]>();
+        }
+
+        protected override IList<Arg[]> GetRequiredArgs()
+        {
+            // NOTE: We must order this in the sequence of the expected output.
+            return new List<Arg[]>();
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/ea6ec0fa/src/tools/Lucene.Net.Tests.Cli/Commands/Demo/DemoCommandTest.cs
----------------------------------------------------------------------
diff --git a/src/tools/Lucene.Net.Tests.Cli/Commands/Demo/DemoCommandTest.cs b/src/tools/Lucene.Net.Tests.Cli/Commands/Demo/DemoCommandTest.cs
index 4c57bbb..3f448fa 100644
--- a/src/tools/Lucene.Net.Tests.Cli/Commands/Demo/DemoCommandTest.cs
+++ b/src/tools/Lucene.Net.Tests.Cli/Commands/Demo/DemoCommandTest.cs
@@ -40,7 +40,7 @@ namespace Lucene.Net.Cli.Commands
         }
 
         [Test]
-        public void TestTooManyArguments()
+        public virtual void TestTooManyArguments()
         {
             Assert.Throws<CommandParsingException>(() => AssertConsoleOutput("one", ""));
         }

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/ea6ec0fa/src/tools/Lucene.Net.Tests.Cli/Commands/Demo/DemoDistanceFacetsCommandTest.cs
----------------------------------------------------------------------
diff --git a/src/tools/Lucene.Net.Tests.Cli/Commands/Demo/DemoDistanceFacetsCommandTest.cs b/src/tools/Lucene.Net.Tests.Cli/Commands/Demo/DemoDistanceFacetsCommandTest.cs
new file mode 100644
index 0000000..b454ce7
--- /dev/null
+++ b/src/tools/Lucene.Net.Tests.Cli/Commands/Demo/DemoDistanceFacetsCommandTest.cs
@@ -0,0 +1,41 @@
+using System.Collections.Generic;
+
+namespace Lucene.Net.Cli.Commands.Demo
+{
+    /*
+     * Licensed to the Apache Software Foundation (ASF) under one or more
+     * contributor license agreements.  See the NOTICE file distributed with
+     * this work for additional information regarding copyright ownership.
+     * The ASF licenses this file to You under the Apache License, Version 2.0
+     * (the "License"); you may not use this file except in compliance with
+     * the License.  You may obtain a copy of the License at
+     *
+     *     http://www.apache.org/licenses/LICENSE-2.0
+     *
+     * Unless required by applicable law or agreed to in writing, software
+     * distributed under the License is distributed on an "AS IS" BASIS,
+     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     * See the License for the specific language governing permissions and
+     * limitations under the License.
+     */
+
+    public class DemoDistanceFacetsCommandTest : CommandTestCase
+    {
+        protected override ConfigurationBase CreateConfiguration(MockConsoleApp app)
+        {
+            return new DemoDistanceFacetsCommand.Configuration(new CommandLineOptions()) { Main = (args) => app.Main(args) };
+        }
+
+        protected override IList<Arg[]> GetOptionalArgs()
+        {
+            return new List<Arg[]>();
+        }
+
+        protected override IList<Arg[]> GetRequiredArgs()
+        {
+            // NOTE: We must order this in the sequence of the expected output.
+            return new List<Arg[]>();
+        }
+    }
+}
+

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/ea6ec0fa/src/tools/Lucene.Net.Tests.Cli/Commands/Demo/DemoExpressionAggregationFacetsCommandTest.cs
----------------------------------------------------------------------
diff --git a/src/tools/Lucene.Net.Tests.Cli/Commands/Demo/DemoExpressionAggregationFacetsCommandTest.cs b/src/tools/Lucene.Net.Tests.Cli/Commands/Demo/DemoExpressionAggregationFacetsCommandTest.cs
new file mode 100644
index 0000000..12576ea
--- /dev/null
+++ b/src/tools/Lucene.Net.Tests.Cli/Commands/Demo/DemoExpressionAggregationFacetsCommandTest.cs
@@ -0,0 +1,42 @@
+using System.Collections.Generic;
+
+namespace Lucene.Net.Cli.Commands.Demo
+{
+    /*
+     * Licensed to the Apache Software Foundation (ASF) under one or more
+     * contributor license agreements.  See the NOTICE file distributed with
+     * this work for additional information regarding copyright ownership.
+     * The ASF licenses this file to You under the Apache License, Version 2.0
+     * (the "License"); you may not use this file except in compliance with
+     * the License.  You may obtain a copy of the License at
+     *
+     *     http://www.apache.org/licenses/LICENSE-2.0
+     *
+     * Unless required by applicable law or agreed to in writing, software
+     * distributed under the License is distributed on an "AS IS" BASIS,
+     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     * See the License for the specific language governing permissions and
+     * limitations under the License.
+     */
+
+    public class DemoExpressionAggregationFacetsCommandTest : CommandTestCase
+    {
+        protected override ConfigurationBase CreateConfiguration(MockConsoleApp app)
+        {
+            return new DemoExpressionAggregationFacetsCommand.Configuration(new CommandLineOptions()) { Main = (args) => app.Main(args) };
+        }
+
+        protected override IList<Arg[]> GetOptionalArgs()
+        {
+            return new List<Arg[]>();
+        }
+
+        protected override IList<Arg[]> GetRequiredArgs()
+        {
+            // NOTE: We must order this in the sequence of the expected output.
+            return new List<Arg[]>();
+        }
+    }
+}
+
+

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/ea6ec0fa/src/tools/Lucene.Net.Tests.Cli/Commands/Demo/DemoIndexFilesCommandTest.cs
----------------------------------------------------------------------
diff --git a/src/tools/Lucene.Net.Tests.Cli/Commands/Demo/DemoIndexFilesCommandTest.cs b/src/tools/Lucene.Net.Tests.Cli/Commands/Demo/DemoIndexFilesCommandTest.cs
new file mode 100644
index 0000000..e892eb1
--- /dev/null
+++ b/src/tools/Lucene.Net.Tests.Cli/Commands/Demo/DemoIndexFilesCommandTest.cs
@@ -0,0 +1,61 @@
+using Lucene.Net.Cli.CommandLine;
+using NUnit.Framework;
+using System.Collections.Generic;
+
+namespace Lucene.Net.Cli.Commands.Demo
+{
+    /*
+     * Licensed to the Apache Software Foundation (ASF) under one or more
+     * contributor license agreements.  See the NOTICE file distributed with
+     * this work for additional information regarding copyright ownership.
+     * The ASF licenses this file to You under the Apache License, Version 2.0
+     * (the "License"); you may not use this file except in compliance with
+     * the License.  You may obtain a copy of the License at
+     *
+     *     http://www.apache.org/licenses/LICENSE-2.0
+     *
+     * Unless required by applicable law or agreed to in writing, software
+     * distributed under the License is distributed on an "AS IS" BASIS,
+     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     * See the License for the specific language governing permissions and
+     * limitations under the License.
+     */
+
+    public class DemoIndexFilesCommandTest : CommandTestCase
+    {
+        protected override ConfigurationBase CreateConfiguration(MockConsoleApp app)
+        {
+            return new DemoIndexFilesCommand.Configuration(new CommandLineOptions()) { Main = (args) => app.Main(args) };
+        }
+
+        protected override IList<Arg[]> GetOptionalArgs()
+        {
+            return new List<Arg[]>()
+            {
+                new Arg[] { new Arg(inputPattern: "-u|--update", output: new string[] { "--update" }) },
+            };
+        }
+
+        protected override IList<Arg[]> GetRequiredArgs()
+        {
+            // NOTE: We must order this in the sequence of the expected output.
+            return new List<Arg[]>()
+            {
+                new Arg[] { new Arg(inputPattern: @"C:\lucene-temp", output: new string[] { @"C:\lucene-temp" }) },
+                new Arg[] { new Arg(inputPattern: @"C:\lucene-temp2", output: new string[] { @"C:\lucene-temp2" }) },
+            };
+        }
+
+        [Test]
+        public virtual void TestNotEnoughArguments()
+        {
+            AssertConsoleOutput("one", FromResource("NotEnoughArguments", 2));
+        }
+
+        [Test]
+        public virtual void TestTooManyArguments()
+        {
+            Assert.Throws<CommandParsingException>(() => AssertConsoleOutput("one two three", ""));
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/ea6ec0fa/src/tools/Lucene.Net.Tests.Cli/Commands/Demo/DemoMultiCategoryListsFacetsCommandTest.cs
----------------------------------------------------------------------
diff --git a/src/tools/Lucene.Net.Tests.Cli/Commands/Demo/DemoMultiCategoryListsFacetsCommandTest.cs b/src/tools/Lucene.Net.Tests.Cli/Commands/Demo/DemoMultiCategoryListsFacetsCommandTest.cs
new file mode 100644
index 0000000..dca20cc
--- /dev/null
+++ b/src/tools/Lucene.Net.Tests.Cli/Commands/Demo/DemoMultiCategoryListsFacetsCommandTest.cs
@@ -0,0 +1,40 @@
+using System.Collections.Generic;
+
+namespace Lucene.Net.Cli.Commands.Demo
+{
+    /*
+     * Licensed to the Apache Software Foundation (ASF) under one or more
+     * contributor license agreements.  See the NOTICE file distributed with
+     * this work for additional information regarding copyright ownership.
+     * The ASF licenses this file to You under the Apache License, Version 2.0
+     * (the "License"); you may not use this file except in compliance with
+     * the License.  You may obtain a copy of the License at
+     *
+     *     http://www.apache.org/licenses/LICENSE-2.0
+     *
+     * Unless required by applicable law or agreed to in writing, software
+     * distributed under the License is distributed on an "AS IS" BASIS,
+     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     * See the License for the specific language governing permissions and
+     * limitations under the License.
+     */
+
+    public class DemoMultiCategoryListsFacetsCommandTest : CommandTestCase
+    {
+        protected override ConfigurationBase CreateConfiguration(MockConsoleApp app)
+        {
+            return new DemoMultiCategoryListsFacetsCommand.Configuration(new CommandLineOptions()) { Main = (args) => app.Main(args) };
+        }
+
+        protected override IList<Arg[]> GetOptionalArgs()
+        {
+            return new List<Arg[]>();
+        }
+
+        protected override IList<Arg[]> GetRequiredArgs()
+        {
+            // NOTE: We must order this in the sequence of the expected output.
+            return new List<Arg[]>();
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/ea6ec0fa/src/tools/Lucene.Net.Tests.Cli/Commands/Demo/DemoRangeFacetsCommandTest.cs
----------------------------------------------------------------------
diff --git a/src/tools/Lucene.Net.Tests.Cli/Commands/Demo/DemoRangeFacetsCommandTest.cs b/src/tools/Lucene.Net.Tests.Cli/Commands/Demo/DemoRangeFacetsCommandTest.cs
new file mode 100644
index 0000000..d97c47c
--- /dev/null
+++ b/src/tools/Lucene.Net.Tests.Cli/Commands/Demo/DemoRangeFacetsCommandTest.cs
@@ -0,0 +1,40 @@
+using System.Collections.Generic;
+
+namespace Lucene.Net.Cli.Commands.Demo
+{
+    /*
+     * Licensed to the Apache Software Foundation (ASF) under one or more
+     * contributor license agreements.  See the NOTICE file distributed with
+     * this work for additional information regarding copyright ownership.
+     * The ASF licenses this file to You under the Apache License, Version 2.0
+     * (the "License"); you may not use this file except in compliance with
+     * the License.  You may obtain a copy of the License at
+     *
+     *     http://www.apache.org/licenses/LICENSE-2.0
+     *
+     * Unless required by applicable law or agreed to in writing, software
+     * distributed under the License is distributed on an "AS IS" BASIS,
+     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     * See the License for the specific language governing permissions and
+     * limitations under the License.
+     */
+
+    public class DemoRangeFacetsCommandTest : CommandTestCase
+    {
+        protected override ConfigurationBase CreateConfiguration(MockConsoleApp app)
+        {
+            return new DemoRangeFacetsCommand.Configuration(new CommandLineOptions()) { Main = (args) => app.Main(args) };
+        }
+
+        protected override IList<Arg[]> GetOptionalArgs()
+        {
+            return new List<Arg[]>();
+        }
+
+        protected override IList<Arg[]> GetRequiredArgs()
+        {
+            // NOTE: We must order this in the sequence of the expected output.
+            return new List<Arg[]>();
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/ea6ec0fa/src/tools/Lucene.Net.Tests.Cli/Commands/Demo/DemoSearchFilesCommandTest.cs
----------------------------------------------------------------------
diff --git a/src/tools/Lucene.Net.Tests.Cli/Commands/Demo/DemoSearchFilesCommandTest.cs b/src/tools/Lucene.Net.Tests.Cli/Commands/Demo/DemoSearchFilesCommandTest.cs
new file mode 100644
index 0000000..3ae64be
--- /dev/null
+++ b/src/tools/Lucene.Net.Tests.Cli/Commands/Demo/DemoSearchFilesCommandTest.cs
@@ -0,0 +1,64 @@
+using Lucene.Net.Cli.CommandLine;
+using NUnit.Framework;
+using System.Collections.Generic;
+
+namespace Lucene.Net.Cli.Commands.Demo
+{
+    /*
+     * Licensed to the Apache Software Foundation (ASF) under one or more
+     * contributor license agreements.  See the NOTICE file distributed with
+     * this work for additional information regarding copyright ownership.
+     * The ASF licenses this file to You under the Apache License, Version 2.0
+     * (the "License"); you may not use this file except in compliance with
+     * the License.  You may obtain a copy of the License at
+     *
+     *     http://www.apache.org/licenses/LICENSE-2.0
+     *
+     * Unless required by applicable law or agreed to in writing, software
+     * distributed under the License is distributed on an "AS IS" BASIS,
+     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     * See the License for the specific language governing permissions and
+     * limitations under the License.
+     */
+
+    public class DemoSearchFilesCommandTest : CommandTestCase
+    {
+        protected override ConfigurationBase CreateConfiguration(MockConsoleApp app)
+        {
+            return new DemoSearchFilesCommand.Configuration(new CommandLineOptions()) { Main = (args) => app.Main(args) };
+        }
+
+        protected override IList<Arg[]> GetOptionalArgs()
+        {
+            return new List<Arg[]>()
+            {
+                new Arg[] { new Arg(inputPattern: "-f fieldName|--field fieldName", output: new string[] { "--field", "fieldName" }) },
+                new Arg[] { new Arg(inputPattern: "-r 10|--repeat 10", output: new string[] { "--repeat", "10" }) },
+                new Arg[] { new Arg(inputPattern: @"-qf C:\lucene-temp2\queries.txt|--queries-file C:\lucene-temp2\queries.txt", output: new string[] { "--queries-file", @"C:\lucene-temp2\queries.txt" }) },
+                new Arg[] { new Arg(inputPattern: "--raw", output: new string[] { "--raw" }) },
+                new Arg[] { new Arg(inputPattern: "-p 15|--page-size 15", output: new string[] { "--page-size", "15" }) },
+            };
+        }
+
+        protected override IList<Arg[]> GetRequiredArgs()
+        {
+            // NOTE: We must order this in the sequence of the expected output.
+            return new List<Arg[]>()
+            {
+                new Arg[] { new Arg(inputPattern: @"C:\lucene-temp", output: new string[] { @"C:\lucene-temp" }) },
+            };
+        }
+
+        [Test]
+        public virtual void TestNotEnoughArguments()
+        {
+            AssertConsoleOutput("", FromResource("NotEnoughArguments", 1));
+        }
+
+        [Test]
+        public virtual void TestTooManyArguments()
+        {
+            Assert.Throws<CommandParsingException>(() => AssertConsoleOutput("one two", ""));
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/ea6ec0fa/src/tools/Lucene.Net.Tests.Cli/Commands/Demo/DemoSimpleFacetsCommandTest.cs
----------------------------------------------------------------------
diff --git a/src/tools/Lucene.Net.Tests.Cli/Commands/Demo/DemoSimpleFacetsCommandTest.cs b/src/tools/Lucene.Net.Tests.Cli/Commands/Demo/DemoSimpleFacetsCommandTest.cs
new file mode 100644
index 0000000..8db37e2
--- /dev/null
+++ b/src/tools/Lucene.Net.Tests.Cli/Commands/Demo/DemoSimpleFacetsCommandTest.cs
@@ -0,0 +1,40 @@
+using System.Collections.Generic;
+
+namespace Lucene.Net.Cli.Commands.Demo
+{
+    /*
+     * Licensed to the Apache Software Foundation (ASF) under one or more
+     * contributor license agreements.  See the NOTICE file distributed with
+     * this work for additional information regarding copyright ownership.
+     * The ASF licenses this file to You under the Apache License, Version 2.0
+     * (the "License"); you may not use this file except in compliance with
+     * the License.  You may obtain a copy of the License at
+     *
+     *     http://www.apache.org/licenses/LICENSE-2.0
+     *
+     * Unless required by applicable law or agreed to in writing, software
+     * distributed under the License is distributed on an "AS IS" BASIS,
+     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     * See the License for the specific language governing permissions and
+     * limitations under the License.
+     */
+
+    public class DemoSimpleFacetsCommandTest : CommandTestCase
+    {
+        protected override ConfigurationBase CreateConfiguration(MockConsoleApp app)
+        {
+            return new DemoSimpleFacetsCommand.Configuration(new CommandLineOptions()) { Main = (args) => app.Main(args) };
+        }
+
+        protected override IList<Arg[]> GetOptionalArgs()
+        {
+            return new List<Arg[]>();
+        }
+
+        protected override IList<Arg[]> GetRequiredArgs()
+        {
+            // NOTE: We must order this in the sequence of the expected output.
+            return new List<Arg[]>();
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/ea6ec0fa/src/tools/Lucene.Net.Tests.Cli/Commands/Demo/DemoSimpleSortedSetFacetsCommandTest.cs
----------------------------------------------------------------------
diff --git a/src/tools/Lucene.Net.Tests.Cli/Commands/Demo/DemoSimpleSortedSetFacetsCommandTest.cs b/src/tools/Lucene.Net.Tests.Cli/Commands/Demo/DemoSimpleSortedSetFacetsCommandTest.cs
new file mode 100644
index 0000000..a7bcfc3
--- /dev/null
+++ b/src/tools/Lucene.Net.Tests.Cli/Commands/Demo/DemoSimpleSortedSetFacetsCommandTest.cs
@@ -0,0 +1,40 @@
+using System.Collections.Generic;
+
+namespace Lucene.Net.Cli.Commands.Demo
+{
+    /*
+     * Licensed to the Apache Software Foundation (ASF) under one or more
+     * contributor license agreements.  See the NOTICE file distributed with
+     * this work for additional information regarding copyright ownership.
+     * The ASF licenses this file to You under the Apache License, Version 2.0
+     * (the "License"); you may not use this file except in compliance with
+     * the License.  You may obtain a copy of the License at
+     *
+     *     http://www.apache.org/licenses/LICENSE-2.0
+     *
+     * Unless required by applicable law or agreed to in writing, software
+     * distributed under the License is distributed on an "AS IS" BASIS,
+     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     * See the License for the specific language governing permissions and
+     * limitations under the License.
+     */
+
+    public class DemoSimpleSortedSetFacetsCommandTest : CommandTestCase
+    {
+        protected override ConfigurationBase CreateConfiguration(MockConsoleApp app)
+        {
+            return new DemoSimpleSortedSetFacetsCommand.Configuration(new CommandLineOptions()) { Main = (args) => app.Main(args) };
+        }
+
+        protected override IList<Arg[]> GetOptionalArgs()
+        {
+            return new List<Arg[]>();
+        }
+
+        protected override IList<Arg[]> GetRequiredArgs()
+        {
+            // NOTE: We must order this in the sequence of the expected output.
+            return new List<Arg[]>();
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/ea6ec0fa/src/tools/Lucene.Net.Tests.Cli/Commands/Index/IndexCheckCommandTest.cs
----------------------------------------------------------------------
diff --git a/src/tools/Lucene.Net.Tests.Cli/Commands/Index/IndexCheckCommandTest.cs b/src/tools/Lucene.Net.Tests.Cli/Commands/Index/IndexCheckCommandTest.cs
index 0ec00ef..5521124 100644
--- a/src/tools/Lucene.Net.Tests.Cli/Commands/Index/IndexCheckCommandTest.cs
+++ b/src/tools/Lucene.Net.Tests.Cli/Commands/Index/IndexCheckCommandTest.cs
@@ -35,7 +35,7 @@ namespace Lucene.Net.Cli.Commands
             return new List<Arg[]>()
             {
                 new Arg[] { new Arg(inputPattern: "-c|--cross-check-term-vectors", output: new string[] { "-crossCheckTermVectors" }) },
-                new Arg[] { new Arg(inputPattern: "--verbose", output: new string[] { "-verbose" }) },
+                new Arg[] { new Arg(inputPattern: "-v|--verbose", output: new string[] { "-verbose" }) },
                 new Arg[] {
                     new Arg(inputPattern: "-s _seg1|--segment _seg1", output: new string[] { "-segment", "_seg1" }),
                     new Arg(inputPattern: "-s _seg1 -s _seg2|--segment _seg1 --segment _seg2", output: new string[] { "-segment", "_seg1", "-segment", "_seg2" }),
@@ -53,57 +53,14 @@ namespace Lucene.Net.Cli.Commands
             };
         }
 
-        
-
-
-
-        //[Test]
-        //public void TestAllOptionsShort()
-        //{
-        //    AssertCommandTranslation(
-        //        @"C:\lucene-temp -v -c -dir SimpleFSDirectory -s _seg1 -s _seg2 -s _seg3",
-        //        new string[] {
-        //            @"C:\lucene-temp", "-crossCheckTermVectors", "-verbose",
-        //            "-segment", "_seg1", "-segment", "_seg2", "-segment", "_seg3",
-        //            "-dir-impl", "SimpleFSDirectory"
-        //        });
-
-        //    //var output = new MockConsoleApp();
-        //    //var cmd = new IndexCheckCommand.Configuration(new CommandLineOptions()) { Main = (args) => output.Main(args) };
-
-        //    //string input = @"C:\lucene-temp -v -c -dir SimpleFSDirectory -s _seg1 -s _seg2 -s _seg3";
-        //    //cmd.Execute(input.ToArgs());
-
-        //    //Assert.AreEqual(@"C:\lucene-temp", output.Args[0]);
-        //    //Assert.True(output.Args.Contains("-crossCheckTermVectors"));
-        //    //Assert.True(output.Args.Contains("-verbose"));
-        //    //Assert.AreEqual("SimpleFSDirectory", output.Args.OptionValue("-dir-impl"));
-        //    //Assert.True(new HashSet<string>(output.Args.OptionValues("-segment")).SetEquals(new HashSet<string>(new string[] { "_seg1", "_seg2", "_seg3" })));
-        //    //Assert.False(output.Args.Contains("-fix"));
-        //}
-
-        //[Test]
-        //public void TestAllOptionsLong()
-        //{
-        //    AssertCommandTranslation(
-        //        @"C:\lucene-temp --verbose --cross-check-term-vectors --directory-type SimpleFSDirectory --segment _seg1 --segment _seg2 --segment _seg3",
-        //        new string[] {
-        //            @"C:\lucene-temp", "-crossCheckTermVectors", "-verbose",
-        //            "-segment", "_seg1", "-segment", "_seg2", "-segment", "_seg3",
-        //            "-dir-impl", "SimpleFSDirectory"
-        //        });
-        //}
-
         /// <summary>
         /// Ensures the current working directory is used when index directory is not supplied. 
         /// </summary>
         [Test]
-        public void TestNoArguments()
+        public virtual void TestNoArguments()
         {
             System.IO.Directory.SetCurrentDirectory(@"C:\");
             AssertCommandTranslation("", new string[] { @"C:\" });
         }
-
-        
     }
 }

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/ea6ec0fa/src/tools/Lucene.Net.Tests.Cli/Commands/Index/IndexCommandTest.cs
----------------------------------------------------------------------
diff --git a/src/tools/Lucene.Net.Tests.Cli/Commands/Index/IndexCommandTest.cs b/src/tools/Lucene.Net.Tests.Cli/Commands/Index/IndexCommandTest.cs
index e110667..5ec554b 100644
--- a/src/tools/Lucene.Net.Tests.Cli/Commands/Index/IndexCommandTest.cs
+++ b/src/tools/Lucene.Net.Tests.Cli/Commands/Index/IndexCommandTest.cs
@@ -42,13 +42,13 @@ namespace Lucene.Net.Cli.Commands
         /// Ensures the current working directory is used when index directory is not supplied. 
         /// </summary>
         [Test]
-        public void TestNoArguments()
+        public virtual void TestNoArguments()
         {
             AssertConsoleOutput("", "Lucene.Net Command Line Utility, Version");
         }
 
         [Test]
-        public void TestTooManyArguments()
+        public virtual void TestTooManyArguments()
         {
             Assert.Throws<CommandParsingException>(() => AssertConsoleOutput("one", ""));
         }

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/ea6ec0fa/src/tools/Lucene.Net.Tests.Cli/Commands/Index/IndexCopySegmentsTest.cs
----------------------------------------------------------------------
diff --git a/src/tools/Lucene.Net.Tests.Cli/Commands/Index/IndexCopySegmentsTest.cs b/src/tools/Lucene.Net.Tests.Cli/Commands/Index/IndexCopySegmentsTest.cs
index 68b86c0..3c14af5 100644
--- a/src/tools/Lucene.Net.Tests.Cli/Commands/Index/IndexCopySegmentsTest.cs
+++ b/src/tools/Lucene.Net.Tests.Cli/Commands/Index/IndexCopySegmentsTest.cs
@@ -49,9 +49,8 @@ namespace Lucene.Net.Cli.Commands
         }
 
         [Test]
-        public void TestNotEnoughArguments()
+        public virtual void TestNotEnoughArguments()
         {
-            Assert.NotNull(FromResource("NotEnoughArguments"));
             AssertConsoleOutput("one two", FromResource("NotEnoughArguments", 3));
         }
     }

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/ea6ec0fa/src/tools/Lucene.Net.Tests.Cli/Commands/Index/IndexDeleteSegmentsCommandTest.cs
----------------------------------------------------------------------
diff --git a/src/tools/Lucene.Net.Tests.Cli/Commands/Index/IndexDeleteSegmentsCommandTest.cs b/src/tools/Lucene.Net.Tests.Cli/Commands/Index/IndexDeleteSegmentsCommandTest.cs
index 42a2632..bc72375 100644
--- a/src/tools/Lucene.Net.Tests.Cli/Commands/Index/IndexDeleteSegmentsCommandTest.cs
+++ b/src/tools/Lucene.Net.Tests.Cli/Commands/Index/IndexDeleteSegmentsCommandTest.cs
@@ -49,9 +49,8 @@ namespace Lucene.Net.Cli.Commands
         }
 
         [Test]
-        public void TestNotEnoughArguments()
+        public virtual void TestNotEnoughArguments()
         {
-            Assert.NotNull(FromResource("NotEnoughArguments"));
             AssertConsoleOutput("one", FromResource("NotEnoughArguments", 2));
         }
     }

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/ea6ec0fa/src/tools/Lucene.Net.Tests.Cli/Commands/Index/IndexExtractCfsCommandTest.cs
----------------------------------------------------------------------
diff --git a/src/tools/Lucene.Net.Tests.Cli/Commands/Index/IndexExtractCfsCommandTest.cs b/src/tools/Lucene.Net.Tests.Cli/Commands/Index/IndexExtractCfsCommandTest.cs
index a8ecd92..2325d0d 100644
--- a/src/tools/Lucene.Net.Tests.Cli/Commands/Index/IndexExtractCfsCommandTest.cs
+++ b/src/tools/Lucene.Net.Tests.Cli/Commands/Index/IndexExtractCfsCommandTest.cs
@@ -47,9 +47,8 @@ namespace Lucene.Net.Cli.Commands
         }
 
         [Test]
-        public void TestNotEnoughArguments()
+        public virtual void TestNotEnoughArguments()
         {
-            Assert.NotNull(FromResource("NotEnoughArguments"));
             AssertConsoleOutput("", FromResource("NotEnoughArguments", 1));
         }
     }

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/ea6ec0fa/src/tools/Lucene.Net.Tests.Cli/Commands/Index/IndexFixCommandTest.cs
----------------------------------------------------------------------
diff --git a/src/tools/Lucene.Net.Tests.Cli/Commands/Index/IndexFixCommandTest.cs b/src/tools/Lucene.Net.Tests.Cli/Commands/Index/IndexFixCommandTest.cs
index 105606d..29a2b4c 100644
--- a/src/tools/Lucene.Net.Tests.Cli/Commands/Index/IndexFixCommandTest.cs
+++ b/src/tools/Lucene.Net.Tests.Cli/Commands/Index/IndexFixCommandTest.cs
@@ -1,6 +1,7 @@
 using Lucene.Net.Cli.CommandLine;
 using NUnit.Framework;
 using System.Collections.Generic;
+using System.Linq;
 
 namespace Lucene.Net.Cli.Commands
 {
@@ -33,13 +34,12 @@ namespace Lucene.Net.Cli.Commands
             // NOTE: We must order this in the sequence of the expected output.
             return new List<Arg[]>()
             {
-                new Arg[] { new Arg(inputPattern: "-c|--cross-check-term-vectors", output: new string[] { "-crossCheckTermVectors" }) },
-                new Arg[] { new Arg(inputPattern: "--verbose", output: new string[] { "-verbose" }) },
                 new Arg[] {
-                    new Arg(inputPattern: "-s _seg1|--segment _seg1", output: new string[] { "-segment", "_seg1" }),
-                    new Arg(inputPattern: "-s _seg1 -s _seg2|--segment _seg1 --segment _seg2", output: new string[] { "-segment", "_seg1", "-segment", "_seg2" }),
-                    new Arg(inputPattern: "-s _seg1 -s _seg2 -s _seg3|--segment _seg1 --segment _seg2 --segment _seg3", output: new string[] { "-segment", "_seg1", "-segment", "_seg2", "-segment", "_seg3" })
+                    new Arg(inputPattern: "", output: new string[] { "-fix" }),
+                    new Arg(inputPattern: "--dry-run", output: new string[0]),
                 },
+                new Arg[] { new Arg(inputPattern: "-c|--cross-check-term-vectors", output: new string[] { "-crossCheckTermVectors" }) },
+                new Arg[] { new Arg(inputPattern: "-v|--verbose", output: new string[] { "-verbose" }) },
                 new Arg[] { new Arg(inputPattern: "-dir SimpleFSDirectory|--directory-type SimpleFSDirectory", output: new string[] { "-dir-impl", "SimpleFSDirectory" }) },
             };
         }
@@ -49,20 +49,48 @@ namespace Lucene.Net.Cli.Commands
             // NOTE: We must order this in the sequence of the expected output.
             return new List<Arg[]>()
             {
-                new Arg[] { new Arg(inputPattern: @"C:\lucene-temp", output: new string[] { @"C:\lucene-temp" }) },
-                new Arg[] { new Arg(inputPattern: "", output: new string[] { "-fix" }) },
+                new Arg[] { new Arg(inputPattern: @"C:\lucene-temp", output: new string[] { @"C:\lucene-temp" }) }
             };
         }
 
         [Test]
-        public void TestNoArguments()
+        public override void TestAllValidCombinations()
+        {
+            var requiredArgs = GetRequiredArgs().ExpandArgs().RequiredParameters();
+            var optionalArgs = GetOptionalArgs().ExpandArgs().OptionalParameters();
+
+            foreach (var requiredArg in requiredArgs)
+            {
+                AssertCommandTranslation(
+                    string.Join(" ", requiredArg.Select(x => x.InputPattern).ToArray()),
+                    requiredArg.SelectMany(x => x.Output)
+                    // Special case - the -fix option must be specified when --dry-run is not
+                    .Concat(new string[] { "-fix" }).ToArray());
+            }
+
+            foreach (var requiredArg in requiredArgs)
+            {
+                foreach (var optionalArg in optionalArgs)
+                {
+                    string command = string.Join(" ", requiredArg.Select(x => x.InputPattern).Union(optionalArg.Select(x => x.InputPattern).ToArray()));
+                    string[] expected = requiredArg.SelectMany(x => x.Output)
+                        // Special case - the -fix option must be specified when --dry-run is not
+                        .Concat(command.Contains("--dry-run") ? new string[0] : new string[] { "-fix" })
+                        .Union(optionalArg.SelectMany(x => x.Output)).ToArray();
+                    AssertCommandTranslation(command, expected);
+                }
+            }
+        }
+
+        [Test]
+        public virtual void TestNoArguments()
         {
             System.IO.Directory.SetCurrentDirectory(@"C:\");
             AssertCommandTranslation("", new string[] { @"C:\", "-fix" });
         }
 
         [Test]
-        public void TestTooManyArguments()
+        public virtual void TestTooManyArguments()
         {
             Assert.Throws<CommandParsingException>(() => AssertConsoleOutput("one two", ""));
         }

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/ea6ec0fa/src/tools/Lucene.Net.Tests.Cli/Commands/Index/IndexListCfsCommandTest.cs
----------------------------------------------------------------------
diff --git a/src/tools/Lucene.Net.Tests.Cli/Commands/Index/IndexListCfsCommandTest.cs b/src/tools/Lucene.Net.Tests.Cli/Commands/Index/IndexListCfsCommandTest.cs
index 46b014c..244e2fc 100644
--- a/src/tools/Lucene.Net.Tests.Cli/Commands/Index/IndexListCfsCommandTest.cs
+++ b/src/tools/Lucene.Net.Tests.Cli/Commands/Index/IndexListCfsCommandTest.cs
@@ -23,7 +23,7 @@ namespace Lucene.Net.Cli.Commands
 
     public class IndexListCfsCommandTest : CommandTestCase
     {
-        
+
         protected override ConfigurationBase CreateConfiguration(MockConsoleApp app)
         {
             return new IndexListCfsCommand.Configuration(new CommandLineOptions()) { Main = (args) => app.Main(args) };
@@ -48,22 +48,15 @@ namespace Lucene.Net.Cli.Commands
         }
 
         [Test]
-        public void TestNotEnoughArguments()
+        public virtual void TestNotEnoughArguments()
         {
-            Assert.NotNull(FromResource("NotEnoughArguments"));
             AssertConsoleOutput("", FromResource("NotEnoughArguments", 1));
         }
 
         [Test]
-        public void TestTooManyArguments()
+        public virtual void TestTooManyArguments()
         {
             Assert.Throws<CommandParsingException>(() => AssertConsoleOutput("one two", ""));
         }
-
-        [Test]
-        public override void TestHelp()
-        {
-            base.TestHelp();
-        }
     }
 }

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/ea6ec0fa/src/tools/Lucene.Net.Tests.Cli/Commands/Index/IndexListHighFreqTermsCommandTest.cs
----------------------------------------------------------------------
diff --git a/src/tools/Lucene.Net.Tests.Cli/Commands/Index/IndexListHighFreqTermsCommandTest.cs b/src/tools/Lucene.Net.Tests.Cli/Commands/Index/IndexListHighFreqTermsCommandTest.cs
index fc937ad..e12aeea 100644
--- a/src/tools/Lucene.Net.Tests.Cli/Commands/Index/IndexListHighFreqTermsCommandTest.cs
+++ b/src/tools/Lucene.Net.Tests.Cli/Commands/Index/IndexListHighFreqTermsCommandTest.cs
@@ -52,14 +52,14 @@ namespace Lucene.Net.Cli.Commands
         /// Ensures the current working directory is used when index directory is not supplied. 
         /// </summary>
         [Test]
-        public void TestNoArguments()
+        public virtual void TestNoArguments()
         {
             System.IO.Directory.SetCurrentDirectory(@"C:\");
             AssertCommandTranslation("", new string[] { @"C:\" });
         }
 
         [Test]
-        public void TestTooManyArguments()
+        public virtual void TestTooManyArguments()
         {
             Assert.Throws<CommandParsingException>(() => AssertConsoleOutput("one two", ""));
         }

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/ea6ec0fa/src/tools/Lucene.Net.Tests.Cli/Commands/Index/IndexListSegmentsCommandTest.cs
----------------------------------------------------------------------
diff --git a/src/tools/Lucene.Net.Tests.Cli/Commands/Index/IndexListSegmentsCommandTest.cs b/src/tools/Lucene.Net.Tests.Cli/Commands/Index/IndexListSegmentsCommandTest.cs
index c4297c7..a8e4837 100644
--- a/src/tools/Lucene.Net.Tests.Cli/Commands/Index/IndexListSegmentsCommandTest.cs
+++ b/src/tools/Lucene.Net.Tests.Cli/Commands/Index/IndexListSegmentsCommandTest.cs
@@ -48,14 +48,14 @@ namespace Lucene.Net.Cli.Commands
         /// Ensures the current working directory is used when index directory is not supplied. 
         /// </summary>
         [Test]
-        public void TestNoArguments()
+        public virtual void TestNoArguments()
         {
             System.IO.Directory.SetCurrentDirectory(@"C:\");
             AssertCommandTranslation("", new string[] { @"C:\", "-l" });
         }
 
         [Test]
-        public void TestTooManyArguments()
+        public virtual void TestTooManyArguments()
         {
             Assert.Throws<CommandParsingException>(() => AssertConsoleOutput("one two", ""));
         }

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/ea6ec0fa/src/tools/Lucene.Net.Tests.Cli/Commands/Index/IndexListTaxonomyStatsCommandTest.cs
----------------------------------------------------------------------
diff --git a/src/tools/Lucene.Net.Tests.Cli/Commands/Index/IndexListTaxonomyStatsCommandTest.cs b/src/tools/Lucene.Net.Tests.Cli/Commands/Index/IndexListTaxonomyStatsCommandTest.cs
index 8539200..4b35516 100644
--- a/src/tools/Lucene.Net.Tests.Cli/Commands/Index/IndexListTaxonomyStatsCommandTest.cs
+++ b/src/tools/Lucene.Net.Tests.Cli/Commands/Index/IndexListTaxonomyStatsCommandTest.cs
@@ -50,14 +50,14 @@ namespace Lucene.Net.Cli.Commands
         /// Ensures the current working directory is used when index directory is not supplied. 
         /// </summary>
         [Test]
-        public void TestNoArguments()
+        public virtual void TestNoArguments()
         {
             System.IO.Directory.SetCurrentDirectory(@"C:\");
             AssertCommandTranslation("", new string[] { @"C:\" });
         }
 
         [Test]
-        public void TestTooManyArguments()
+        public virtual void TestTooManyArguments()
         {
             Assert.Throws<CommandParsingException>(() => AssertConsoleOutput("one two", ""));
         }

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/ea6ec0fa/src/tools/Lucene.Net.Tests.Cli/Commands/Index/IndexListTermInfoCommandTest.cs
----------------------------------------------------------------------
diff --git a/src/tools/Lucene.Net.Tests.Cli/Commands/Index/IndexListTermInfoCommandTest.cs b/src/tools/Lucene.Net.Tests.Cli/Commands/Index/IndexListTermInfoCommandTest.cs
index 09a536a..1b97cf2 100644
--- a/src/tools/Lucene.Net.Tests.Cli/Commands/Index/IndexListTermInfoCommandTest.cs
+++ b/src/tools/Lucene.Net.Tests.Cli/Commands/Index/IndexListTermInfoCommandTest.cs
@@ -46,14 +46,13 @@ namespace Lucene.Net.Cli.Commands
         }
 
         [Test]
-        public void TestNotEnoughArguments()
+        public virtual void TestNotEnoughArguments()
         {
-            Assert.NotNull(FromResource("NotEnoughArguments"));
             AssertConsoleOutput("", FromResource("NotEnoughArguments", 3));
         }
 
         [Test]
-        public void TestTooManyArguments()
+        public virtual void TestTooManyArguments()
         {
             Assert.Throws<CommandParsingException>(() => AssertConsoleOutput("one two three four", ""));
         }

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/ea6ec0fa/src/tools/Lucene.Net.Tests.Cli/Commands/Index/IndexMergeCommandTest.cs
----------------------------------------------------------------------
diff --git a/src/tools/Lucene.Net.Tests.Cli/Commands/Index/IndexMergeCommandTest.cs b/src/tools/Lucene.Net.Tests.Cli/Commands/Index/IndexMergeCommandTest.cs
index f425eab..7dba980 100644
--- a/src/tools/Lucene.Net.Tests.Cli/Commands/Index/IndexMergeCommandTest.cs
+++ b/src/tools/Lucene.Net.Tests.Cli/Commands/Index/IndexMergeCommandTest.cs
@@ -48,9 +48,8 @@ namespace Lucene.Net.Cli.Commands
         }
 
         [Test]
-        public void TestNotEnoughArguments()
+        public virtual void TestNotEnoughArguments()
         {
-            Assert.NotNull(FromResource("NotEnoughArguments"));
             AssertConsoleOutput("", FromResource("NotEnoughArguments", 3));
         }
     }

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/ea6ec0fa/src/tools/Lucene.Net.Tests.Cli/Commands/Index/IndexSplitCommandTest.cs
----------------------------------------------------------------------
diff --git a/src/tools/Lucene.Net.Tests.Cli/Commands/Index/IndexSplitCommandTest.cs b/src/tools/Lucene.Net.Tests.Cli/Commands/Index/IndexSplitCommandTest.cs
index bf0ef31..c5a9017 100644
--- a/src/tools/Lucene.Net.Tests.Cli/Commands/Index/IndexSplitCommandTest.cs
+++ b/src/tools/Lucene.Net.Tests.Cli/Commands/Index/IndexSplitCommandTest.cs
@@ -53,9 +53,8 @@ namespace Lucene.Net.Cli.Commands
         }
 
         [Test]
-        public void TestNotEnoughArguments()
+        public virtual void TestNotEnoughArguments()
         {
-            Assert.NotNull(FromResource("NotEnoughArguments"));
             AssertConsoleOutput("", FromResource("NotEnoughArguments", 2));
         }
     }

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/ea6ec0fa/src/tools/Lucene.Net.Tests.Cli/Commands/Index/IndexUpgradeCommandTest.cs
----------------------------------------------------------------------
diff --git a/src/tools/Lucene.Net.Tests.Cli/Commands/Index/IndexUpgradeCommandTest.cs b/src/tools/Lucene.Net.Tests.Cli/Commands/Index/IndexUpgradeCommandTest.cs
index 9b52235..776c3d4 100644
--- a/src/tools/Lucene.Net.Tests.Cli/Commands/Index/IndexUpgradeCommandTest.cs
+++ b/src/tools/Lucene.Net.Tests.Cli/Commands/Index/IndexUpgradeCommandTest.cs
@@ -52,14 +52,14 @@ namespace Lucene.Net.Cli.Commands
         /// Ensures the current working directory is used when index directory is not supplied. 
         /// </summary>
         [Test]
-        public void TestNoArguments()
+        public virtual void TestNoArguments()
         {
             System.IO.Directory.SetCurrentDirectory(@"C:\");
             AssertCommandTranslation("", new string[] { @"C:\" });
         }
 
         [Test]
-        public void TestTooManyArguments()
+        public virtual void TestTooManyArguments()
         {
             Assert.Throws<CommandParsingException>(() => AssertConsoleOutput("one two", ""));
         }

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/ea6ec0fa/src/tools/Lucene.Net.Tests.Cli/Commands/Lock/LockCommandTest.cs
----------------------------------------------------------------------
diff --git a/src/tools/Lucene.Net.Tests.Cli/Commands/Lock/LockCommandTest.cs b/src/tools/Lucene.Net.Tests.Cli/Commands/Lock/LockCommandTest.cs
index d5c1f64..9ac8c04 100644
--- a/src/tools/Lucene.Net.Tests.Cli/Commands/Lock/LockCommandTest.cs
+++ b/src/tools/Lucene.Net.Tests.Cli/Commands/Lock/LockCommandTest.cs
@@ -42,13 +42,13 @@ namespace Lucene.Net.Cli.Commands
         /// Ensures the current working directory is used when index directory is not supplied. 
         /// </summary>
         [Test]
-        public void TestNoArguments()
+        public virtual void TestNoArguments()
         {
             AssertConsoleOutput("", "Lucene.Net Command Line Utility, Version");
         }
 
         [Test]
-        public void TestTooManyArguments()
+        public virtual void TestTooManyArguments()
         {
             Assert.Throws<CommandParsingException>(() => AssertConsoleOutput("one", ""));
         }

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/ea6ec0fa/src/tools/Lucene.Net.Tests.Cli/Commands/Lock/LockStressTestCommandTest.cs
----------------------------------------------------------------------
diff --git a/src/tools/Lucene.Net.Tests.Cli/Commands/Lock/LockStressTestCommandTest.cs b/src/tools/Lucene.Net.Tests.Cli/Commands/Lock/LockStressTestCommandTest.cs
index 462ebb2..948104a 100644
--- a/src/tools/Lucene.Net.Tests.Cli/Commands/Lock/LockStressTestCommandTest.cs
+++ b/src/tools/Lucene.Net.Tests.Cli/Commands/Lock/LockStressTestCommandTest.cs
@@ -49,14 +49,13 @@ namespace Lucene.Net.Cli.Commands
         }
 
         [Test]
-        public void TestNotEnoughArguments()
+        public virtual void TestNotEnoughArguments()
         {
-            Assert.NotNull(FromResource("NotEnoughArguments"));
             AssertConsoleOutput("one two three four five six", FromResource("NotEnoughArguments", 7));
         }
 
         [Test]
-        public void TestTooManyArguments()
+        public virtual void TestTooManyArguments()
         {
             Assert.Throws<CommandParsingException>(() => AssertConsoleOutput("one two three four five six seven eight", ""));
         }

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/ea6ec0fa/src/tools/Lucene.Net.Tests.Cli/Commands/Lock/LockVerifyServerCommandTest.cs
----------------------------------------------------------------------
diff --git a/src/tools/Lucene.Net.Tests.Cli/Commands/Lock/LockVerifyServerCommandTest.cs b/src/tools/Lucene.Net.Tests.Cli/Commands/Lock/LockVerifyServerCommandTest.cs
index a76a99c..485482e 100644
--- a/src/tools/Lucene.Net.Tests.Cli/Commands/Lock/LockVerifyServerCommandTest.cs
+++ b/src/tools/Lucene.Net.Tests.Cli/Commands/Lock/LockVerifyServerCommandTest.cs
@@ -44,14 +44,13 @@ namespace Lucene.Net.Cli.Commands
         }
 
         [Test]
-        public void TestNotEnoughArguments()
+        public virtual void TestNotEnoughArguments()
         {
-            Assert.NotNull(FromResource("NotEnoughArguments"));
             AssertConsoleOutput("one", FromResource("NotEnoughArguments", 2));
         }
 
         [Test]
-        public void TestTooManyArguments()
+        public virtual void TestTooManyArguments()
         {
             Assert.Throws<CommandParsingException>(() => AssertConsoleOutput("one two three", ""));
         }

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/ea6ec0fa/src/tools/Lucene.Net.Tests.Cli/Commands/RootCommandTest.cs
----------------------------------------------------------------------
diff --git a/src/tools/Lucene.Net.Tests.Cli/Commands/RootCommandTest.cs b/src/tools/Lucene.Net.Tests.Cli/Commands/RootCommandTest.cs
index 543cf24..b49b697 100644
--- a/src/tools/Lucene.Net.Tests.Cli/Commands/RootCommandTest.cs
+++ b/src/tools/Lucene.Net.Tests.Cli/Commands/RootCommandTest.cs
@@ -40,9 +40,15 @@ namespace Lucene.Net.Cli.Commands
         }
 
         [Test]
-        public void TestTooManyArguments()
+        public virtual void TestTooManyArguments()
         {
             Assert.Throws<CommandParsingException>(() => AssertConsoleOutput("one", ""));
         }
+
+        [Test]
+        public override void TestCommandHasDescription()
+        {
+            // No need to do this, it is not displayed anyway
+        }
     }
 }

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/ea6ec0fa/src/tools/Lucene.Net.Tests.Cli/EnumerableExtensions.cs
----------------------------------------------------------------------
diff --git a/src/tools/Lucene.Net.Tests.Cli/EnumerableExtensions.cs b/src/tools/Lucene.Net.Tests.Cli/EnumerableExtensions.cs
index 95ad494..ac5bb01 100644
--- a/src/tools/Lucene.Net.Tests.Cli/EnumerableExtensions.cs
+++ b/src/tools/Lucene.Net.Tests.Cli/EnumerableExtensions.cs
@@ -1,4 +1,5 @@
-using System.Collections.Generic;
+using Lucene.Net.Cli.Commands;
+using System.Collections.Generic;
 using System.Linq;
 
 namespace Lucene.Net.Cli
@@ -20,7 +21,7 @@ namespace Lucene.Net.Cli
      * limitations under the License.
      */
 
-    public static class Extensions
+    public static class EnumerableExtensions
     {
         public static IEnumerable<IEnumerable<T>> OptionalParameters<T>(this IEnumerable<IEnumerable<T>> input)
         {
@@ -56,5 +57,36 @@ namespace Lucene.Net.Cli
                 }
             }
         }
+
+        // Breaks out any options based on logical OR | symbol
+        public static IEnumerable<IEnumerable<CommandTestCase.Arg>> ExpandArgs(this IEnumerable<IEnumerable<CommandTestCase.Arg>> args)
+        {
+            foreach (var arg in args)
+            {
+                yield return ExpandArgs(arg);
+            }
+        }
+
+        public static IEnumerable<CommandTestCase.Arg> ExpandArgs(this IEnumerable<CommandTestCase.Arg> args)
+        {
+            if (args != null)
+            {
+                foreach (var arg in args)
+                {
+                    if (arg.InputPattern.Contains("|"))
+                    {
+                        var options = arg.InputPattern.Split('|');
+                        foreach (var option in options)
+                        {
+                            yield return new CommandTestCase.Arg(option, (string[])arg.Output.Clone());
+                        }
+                    }
+                    else
+                    {
+                        yield return arg;
+                    }
+                }
+            }
+        }
     }
 }

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/ea6ec0fa/src/tools/Lucene.Net.Tests.Cli/EnvironmentTest.cs
----------------------------------------------------------------------
diff --git a/src/tools/Lucene.Net.Tests.Cli/EnvironmentTest.cs b/src/tools/Lucene.Net.Tests.Cli/EnvironmentTest.cs
new file mode 100644
index 0000000..29d53c0
--- /dev/null
+++ b/src/tools/Lucene.Net.Tests.Cli/EnvironmentTest.cs
@@ -0,0 +1,20 @@
+using Lucene.Net.Cli.Commands;
+using NUnit.Framework;
+
+namespace Lucene.Net.Cli
+{
+    public class EnvironmentTest
+    {
+        [Test]
+        public virtual void TestNotEnoughArgumentsResourceNotNull()
+        {
+            Assert.NotNull(CommandTestCase.FromResource("NotEnoughArguments"));
+        }
+
+        [Test]
+        public virtual void TestNotEnoughArgumentsResourceNotEmpty()
+        {
+            Assert.IsNotEmpty(CommandTestCase.FromResource("NotEnoughArguments"));
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/ea6ec0fa/src/tools/Lucene.Net.Tests.Cli/StringExtensions.cs
----------------------------------------------------------------------
diff --git a/src/tools/Lucene.Net.Tests.Cli/StringExtensions.cs b/src/tools/Lucene.Net.Tests.Cli/StringExtensions.cs
index eeb4e80..196c9b1 100644
--- a/src/tools/Lucene.Net.Tests.Cli/StringExtensions.cs
+++ b/src/tools/Lucene.Net.Tests.Cli/StringExtensions.cs
@@ -28,41 +28,5 @@ namespace Lucene.Net.Cli
         {
             return Regex.Replace(input.Trim(), @"\s+", " ").Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries).ToArray();
         }
-
-        public static string OptionValue(this IEnumerable<string> args, string option)
-        {
-            return args.SkipWhile(a => a != option).Skip(1).FirstOrDefault();
-        }
-
-        public static IList<string> OptionValues(this IEnumerable<string> args, string option)
-        {
-            var argsList = new List<string>(args);
-            var result = new List<string>();
-            for (int i = 0; i < argsList.Count; i++)
-            {
-                string current = argsList[i];
-                if (current == option)
-                {
-                    if (i == argsList.Count - 1)
-                    {
-                        result.Add(null);
-                    }
-                    else
-                    {
-                        current = argsList[i + 1];
-                        if (current != option)
-                        {
-                            result.Add(current);
-                            i++;
-                        }
-                        else
-                        {
-                            result.Add(null);
-                        }
-                    }
-                }
-            }
-            return result;
-        }
     }
 }

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/ea6ec0fa/src/tools/lucene-cli/Properties/AssemblyInfo.cs
----------------------------------------------------------------------
diff --git a/src/tools/lucene-cli/Properties/AssemblyInfo.cs b/src/tools/lucene-cli/Properties/AssemblyInfo.cs
index 07a71d6..d1118b7 100644
--- a/src/tools/lucene-cli/Properties/AssemblyInfo.cs
+++ b/src/tools/lucene-cli/Properties/AssemblyInfo.cs
@@ -24,7 +24,7 @@ using System.Runtime.InteropServices;
 // associated with an assembly.
 [assembly: AssemblyTitle("lucene-cli")]
 [assembly: AssemblyDescription(
-    "Lucene.Net maintenance utilities and demos.")]
+    "Lucene.Net maintenance utilities and demos. Run 'dotnet lucene-cli.dll' to see usage information.")]
 [assembly: AssemblyConfiguration("")]
 [assembly: AssemblyDefaultAlias("Lucene.Net.Cli")]
 

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/ea6ec0fa/src/tools/lucene-cli/Resources/Strings.Designer.cs
----------------------------------------------------------------------
diff --git a/src/tools/lucene-cli/Resources/Strings.Designer.cs b/src/tools/lucene-cli/Resources/Strings.Designer.cs
index 0db885c..cb790ae 100644
--- a/src/tools/lucene-cli/Resources/Strings.Designer.cs
+++ b/src/tools/lucene-cli/Resources/Strings.Designer.cs
@@ -240,7 +240,7 @@ namespace Lucene.Net.Cli.Resources {
         }
         
         /// <summary>
-        ///    Looks up a localized string similar to Run the index-files demo first to create an index to run this command against. You can either use a file containing many queries, a single query on the command line, or omit both options to run queries interactively..
+        ///    Looks up a localized string similar to Run the index-files demo first to create an index to run this command against. You can either use a file containing many queries (each on a single line), a single query on the command line, or omit both options to run queries interactively..
         /// </summary>
         public static string DemoSearchFilesCommandExtendedHelpText {
             get {
@@ -249,7 +249,7 @@ namespace Lucene.Net.Cli.Resources {
         }
         
         /// <summary>
-        ///    Looks up a localized string similar to The index field to use in the search..
+        ///    Looks up a localized string similar to The index field to use in the search. If not supplied, defaults to &quot;contents&quot;..
         /// </summary>
         public static string DemoSearchFilesCommandFieldDescription {
             get {
@@ -483,7 +483,7 @@ namespace Lucene.Net.Cli.Resources {
         }
         
         /// <summary>
-        ///    Looks up a localized string similar to The .cfs file containing words to parse..
+        ///    Looks up a localized string similar to The .cfs compound file containing words to parse..
         /// </summary>
         public static string IndexExtractCfsCommandCFSFileNameDescription {
             get {
@@ -510,7 +510,7 @@ namespace Lucene.Net.Cli.Resources {
         }
         
         /// <summary>
-        ///    Looks up a localized string similar to Fixes an index with problematic segments..
+        ///    Looks up a localized string similar to Fixes an index by removing problematic segments..
         /// </summary>
         public static string IndexFixCommandDescription {
             get {
@@ -519,7 +519,25 @@ namespace Lucene.Net.Cli.Resources {
         }
         
         /// <summary>
-        ///    Looks up a localized string similar to The .cfs file containing words to parse..
+        ///    Looks up a localized string similar to Doesn&apos;t change the index, but reports any actions that would be taken if this option were not supplied..
+        /// </summary>
+        public static string IndexFixCommandDryRunDescription {
+            get {
+                return ResourceManager.GetString("IndexFixCommandDryRunDescription", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///    Looks up a localized string similar to WARNING: This command should only be used on an emergency basis as it will cause documents (perhaps many) to be permanently removed from the index. Always make a backup copy of your index before running this! Do not run this tool on an index that is actively being written to. You have been warned!.
+        /// </summary>
+        public static string IndexFixCommandExtendedHelpText {
+            get {
+                return ResourceManager.GetString("IndexFixCommandExtendedHelpText", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///    Looks up a localized string similar to The .cfs compound file containing words to parse..
         /// </summary>
         public static string IndexListCfsCommandCFSFileNameDescription {
             get {
@@ -602,18 +620,18 @@ namespace Lucene.Net.Cli.Resources {
         /// <summary>
         ///    Looks up a localized string similar to Displays the taxonomy statistical information for a taxonomy index..
         /// </summary>
-        public static string IndexListTaxonomyStatsDescription {
+        public static string IndexListTaxonomyStatsCommandDescription {
             get {
-                return ResourceManager.GetString("IndexListTaxonomyStatsDescription", resourceCulture);
+                return ResourceManager.GetString("IndexListTaxonomyStatsCommandDescription", resourceCulture);
             }
         }
         
         /// <summary>
         ///    Looks up a localized string similar to Recursively lists all descendent nodes..
         /// </summary>
-        public static string IndexListTaxonomyStatsShowTreeDescription {
+        public static string IndexListTaxonomyStatsCommandShowTreeDescription {
             get {
-                return ResourceManager.GetString("IndexListTaxonomyStatsShowTreeDescription", resourceCulture);
+                return ResourceManager.GetString("IndexListTaxonomyStatsCommandShowTreeDescription", resourceCulture);
             }
         }
         

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/ea6ec0fa/src/tools/lucene-cli/Resources/Strings.resx
----------------------------------------------------------------------
diff --git a/src/tools/lucene-cli/Resources/Strings.resx b/src/tools/lucene-cli/Resources/Strings.resx
index 3634369..2e4ce2a 100644
--- a/src/tools/lucene-cli/Resources/Strings.resx
+++ b/src/tools/lucene-cli/Resources/Strings.resx
@@ -178,10 +178,10 @@
     <value>Simple command-line based search demo. Run index-files demo first.</value>
   </data>
   <data name="DemoSearchFilesCommandExtendedHelpText" xml:space="preserve">
-    <value>Run the index-files demo first to create an index to run this command against. You can either use a file containing many queries, a single query on the command line, or omit both options to run queries interactively.</value>
+    <value>Run the index-files demo first to create an index to run this command against. You can either use a file containing many queries (each on a single line), a single query on the command line, or omit both options to run queries interactively.</value>
   </data>
   <data name="DemoSearchFilesCommandFieldDescription" xml:space="preserve">
-    <value>The index field to use in the search.</value>
+    <value>The index field to use in the search. If not supplied, defaults to "contents".</value>
   </data>
   <data name="DemoSearchFilesCommandPageSizeDescription" xml:space="preserve">
     <value>Hits per page to display.</value>
@@ -259,7 +259,7 @@
     <value>If omitted, it defaults to the current working directory.</value>
   </data>
   <data name="IndexExtractCfsCommandCFSFileNameDescription" xml:space="preserve">
-    <value>The .cfs file containing words to parse.</value>
+    <value>The .cfs compound file containing words to parse.</value>
   </data>
   <data name="IndexExtractCfsCommandDescription" xml:space="preserve">
     <value>Lists sub-files from a .cfs compound file.</value>
@@ -268,10 +268,16 @@
     <value>The .cfs compound file format is created using the CompoundFileDirectory from Lucene.Net.Misc.</value>
   </data>
   <data name="IndexFixCommandDescription" xml:space="preserve">
-    <value>Fixes an index with problematic segments.</value>
+    <value>Fixes an index by removing problematic segments.</value>
+  </data>
+  <data name="IndexFixCommandDryRunDescription" xml:space="preserve">
+    <value>Doesn't change the index, but reports any actions that would be taken if this option were not supplied.</value>
+  </data>
+  <data name="IndexFixCommandExtendedHelpText" xml:space="preserve">
+    <value>WARNING: This command should only be used on an emergency basis as it will cause documents (perhaps many) to be permanently removed from the index. Always make a backup copy of your index before running this! Do not run this tool on an index that is actively being written to. You have been warned!</value>
   </data>
   <data name="IndexListCfsCommandCFSFileNameDescription" xml:space="preserve">
-    <value>The .cfs file containing words to parse.</value>
+    <value>The .cfs compound file containing words to parse.</value>
   </data>
   <data name="IndexListCfsCommandDescription" xml:space="preserve">
     <value>Extracts sub-files out of a .cfs compound file.</value>
@@ -297,10 +303,10 @@
   <data name="IndexListSegmentsCommandDescription" xml:space="preserve">
     <value>Lists segments in an index.</value>
   </data>
-  <data name="IndexListTaxonomyStatsDescription" xml:space="preserve">
+  <data name="IndexListTaxonomyStatsCommandDescription" xml:space="preserve">
     <value>Displays the taxonomy statistical information for a taxonomy index.</value>
   </data>
-  <data name="IndexListTaxonomyStatsShowTreeDescription" xml:space="preserve">
+  <data name="IndexListTaxonomyStatsCommandShowTreeDescription" xml:space="preserve">
     <value>Recursively lists all descendent nodes.</value>
   </data>
   <data name="IndexListTermInfoCommandDescription" xml:space="preserve">

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/ea6ec0fa/src/tools/lucene-cli/commands/analysis/analysis-stempel-patch-stems/AnalysisStempelPatchStemsCommand.cs
----------------------------------------------------------------------
diff --git a/src/tools/lucene-cli/commands/analysis/analysis-stempel-patch-stems/AnalysisStempelPatchStemsCommand.cs b/src/tools/lucene-cli/commands/analysis/analysis-stempel-patch-stems/AnalysisStempelPatchStemsCommand.cs
index 4e24118..6670990 100644
--- a/src/tools/lucene-cli/commands/analysis/analysis-stempel-patch-stems/AnalysisStempelPatchStemsCommand.cs
+++ b/src/tools/lucene-cli/commands/analysis/analysis-stempel-patch-stems/AnalysisStempelPatchStemsCommand.cs
@@ -41,7 +41,7 @@ namespace Lucene.Net.Cli
                     FromResource("StemmerTableFilesEncodingDescription"),
                     CommandOptionType.SingleValue);
 
-                this.OnExecute(() => new IndexListHighFreqTermsCommand().Run(this));
+                this.OnExecute(() => new AnalysisStempelPatchStemsCommand().Run(this));
             }
 
             public virtual CommandArgument StemmerTableFiles { get; private set; }
@@ -60,7 +60,8 @@ namespace Lucene.Net.Cli
 
             if (input.StemmerTableFilesEncoding.HasValue())
             {
-                args.AddRange(input.StemmerTableFilesEncoding.Values);
+                args.Add("--encoding");
+                args.Add(input.StemmerTableFilesEncoding.Value());
             }
 
             cmd.Main(args.ToArray());

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/ea6ec0fa/src/tools/lucene-cli/commands/demo/demo-search-files/DemoSearchFilesCommand.cs
----------------------------------------------------------------------
diff --git a/src/tools/lucene-cli/commands/demo/demo-search-files/DemoSearchFilesCommand.cs b/src/tools/lucene-cli/commands/demo/demo-search-files/DemoSearchFilesCommand.cs
index b40e9c8..a7f6bd6 100644
--- a/src/tools/lucene-cli/commands/demo/demo-search-files/DemoSearchFilesCommand.cs
+++ b/src/tools/lucene-cli/commands/demo/demo-search-files/DemoSearchFilesCommand.cs
@@ -58,7 +58,7 @@ namespace Lucene.Net.Cli
                 this.PageSizeOption = this.Option(
                     "-p|--page-size <NUMBER>",
                     FromResource("PageSizeDescription"),
-                    CommandOptionType.NoValue);
+                    CommandOptionType.SingleValue);
 
 
                 this.OnExecute(() => new DemoSearchFilesCommand().Run(this));
@@ -118,7 +118,6 @@ namespace Lucene.Net.Cli
             if (input.RawOption.HasValue())
             {
                 args.Add("--raw");
-                args.Add(input.RawOption.Value());
             }
 
             if (input.PageSizeOption.HasValue())

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/ea6ec0fa/src/tools/lucene-cli/commands/index/index-extract-cfs/IndexExtractCfsCommand.cs
----------------------------------------------------------------------
diff --git a/src/tools/lucene-cli/commands/index/index-extract-cfs/IndexExtractCfsCommand.cs b/src/tools/lucene-cli/commands/index/index-extract-cfs/IndexExtractCfsCommand.cs
index c3bce19..874f6a6 100644
--- a/src/tools/lucene-cli/commands/index/index-extract-cfs/IndexExtractCfsCommand.cs
+++ b/src/tools/lucene-cli/commands/index/index-extract-cfs/IndexExtractCfsCommand.cs
@@ -31,7 +31,7 @@ namespace Lucene.Net.Cli
                 this.Name = "extract-cfs";
                 this.Description = FromResource("Description");
 
-                this.Argument("<CFS_FILE_NAME>", FromResource("CompoundFileNameDescription"));
+                this.Argument("<CFS_FILE_NAME>", FromResource("CFSFileNameDescription"));
                 this.Options.Add(new DirectoryTypeOption());
                 
                 this.OnExecute(() => new IndexListCfsCommand(extract: true).Run(this));

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/ea6ec0fa/src/tools/lucene-cli/commands/index/index-fix/IndexFixCommand.cs
----------------------------------------------------------------------
diff --git a/src/tools/lucene-cli/commands/index/index-fix/IndexFixCommand.cs b/src/tools/lucene-cli/commands/index/index-fix/IndexFixCommand.cs
index 0418d49..356c46f 100644
--- a/src/tools/lucene-cli/commands/index/index-fix/IndexFixCommand.cs
+++ b/src/tools/lucene-cli/commands/index/index-fix/IndexFixCommand.cs
@@ -1,5 +1,5 @@
-using Lucene.Net.Index;
-using System;
+using Lucene.Net.Cli.CommandLine;
+using Lucene.Net.Index;
 
 namespace Lucene.Net.Cli
 {
@@ -30,21 +30,36 @@ namespace Lucene.Net.Cli
 
                 this.Name = "fix";
                 this.Description = FromResource("Description");
+                this.ExtendedHelpText = FromResource("ExtendedHelpText");
 
                 this.Arguments.Add(new IndexDirectoryArgument());
                 this.Options.Add(new VerboseOption());
                 this.Options.Add(new CrossCheckTermVectorsOption());
                 this.Options.Add(new DirectoryTypeOption());
-                this.Options.Add(new SegmentOption(allowMultiple: true) { Description = FromResource("SegmentsDescpription") });
+                // LUCENENET NOTE: This is effectively the same thing as running
+                // the check command, but using fix doesn't allow the option of
+                // specifying individual segments, so it is better to have an option here.
+                DryRunOption = this.Option("--dry-run",
+                    FromResource("DryRunDescription"),
+                    CommandOptionType.NoValue);
 
-                this.OnExecute(() => new IndexCheckCommand(fix: true).Run(this));
+                this.OnExecute(() => new IndexFixCommand().Run(this));
             }
+
+            public CommandOption DryRunOption { get; private set; }
         }
 
         public int Run(ConfigurationBase cmd)
         {
-            // We call IndexCheckCommand - nothing to do here.
-            throw new NotSupportedException();
+            var input = cmd as Configuration;
+
+            bool fix = true;
+            if (input.DryRunOption.HasValue())
+            {
+                fix = false;
+            }
+
+            return new IndexCheckCommand(fix).Run(cmd);
         }
     }
 }

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/ea6ec0fa/src/tools/lucene-cli/commands/index/index-list-taxonomy-stats/IndexListTaxonomyStatsCommand.cs
----------------------------------------------------------------------
diff --git a/src/tools/lucene-cli/commands/index/index-list-taxonomy-stats/IndexListTaxonomyStatsCommand.cs b/src/tools/lucene-cli/commands/index/index-list-taxonomy-stats/IndexListTaxonomyStatsCommand.cs
index a0336a6..ad985d8 100644
--- a/src/tools/lucene-cli/commands/index/index-list-taxonomy-stats/IndexListTaxonomyStatsCommand.cs
+++ b/src/tools/lucene-cli/commands/index/index-list-taxonomy-stats/IndexListTaxonomyStatsCommand.cs
@@ -33,7 +33,7 @@ namespace Lucene.Net.Cli
                 this.Description = FromResource("Description");
 
                 this.Arguments.Add(new IndexDirectoryArgument());
-                this.ShowTreeOption = this.Option("-tree|--show-tree", FromResource("ShowTreeOption"), CommandOptionType.NoValue);
+                this.ShowTreeOption = this.Option("-tree|--show-tree", FromResource("ShowTreeDescription"), CommandOptionType.NoValue);
 
                 this.OnExecute(() => new IndexListTaxonomyStatsCommand().Run(this));
             }


[10/22] lucenenet git commit: lucene-cli: Added Markdown documentation, and extended help text for many commands. Fixed IndexSplitCommand because MultiPassIndexSplitter doesn't make number of segments an optional argument.

Posted by ni...@apache.org.
lucene-cli: Added Markdown documentation, and extended help text for many commands. Fixed IndexSplitCommand because MultiPassIndexSplitter doesn't make number of segments an optional argument.


Project: http://git-wip-us.apache.org/repos/asf/lucenenet/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucenenet/commit/70f15595
Tree: http://git-wip-us.apache.org/repos/asf/lucenenet/tree/70f15595
Diff: http://git-wip-us.apache.org/repos/asf/lucenenet/diff/70f15595

Branch: refs/heads/master
Commit: 70f15595701a7e7f2803aeb3626a23a6fd6c731d
Parents: ea6ec0f
Author: Shad Storhaug <sh...@shadstorhaug.com>
Authored: Mon Jul 10 11:50:42 2017 +0700
Committer: Shad Storhaug <sh...@shadstorhaug.com>
Committed: Mon Jul 10 11:50:42 2017 +0700

----------------------------------------------------------------------
 .../Commands/Index/IndexFixCommandTest.cs       |   4 +-
 .../Commands/Index/IndexSplitCommandTest.cs     |  34 +++++
 .../lucene-cli/Resources/Strings.Designer.cs    | 130 +++++++++++++------
 src/tools/lucene-cli/Resources/Strings.resx     |  92 ++++++++-----
 .../lucene-cli/arguments/SegmentsArgument.cs    |   2 +-
 .../index/index-check/IndexCheckCommand.cs      |   1 +
 .../IndexCopySegmentsCommand.cs                 |   3 +-
 .../index-extract-cfs/IndexExtractCfsCommand.cs |   1 +
 .../index/index-list-cfs/IndexListCfsCommand.cs |   1 +
 .../IndexListHighFreqTerms.cs                   |   2 +-
 .../IndexSegmentListCommand.cs                  |   1 +
 .../IndexListTaxonomyStatsCommand.cs            |   1 +
 .../IndexListTermInfoCommand.cs                 |   1 +
 .../index/index-split/IndexSplitCommand.cs      |   8 +-
 .../lock-stress-test/LockStressTestCommand.cs   |   9 +-
 src/tools/lucene-cli/docs/analysis/index.md     |  10 ++
 .../docs/analysis/stempel-compile-stems.md      |  37 ++++++
 .../docs/analysis/stempel-patch-stems.md        |  34 +++++
 .../lucene-cli/docs/demo/associations-facets.md |  27 ++++
 .../lucene-cli/docs/demo/distance-facets.md     |  27 ++++
 .../docs/demo/expression-aggregation-facets.md  |  27 ++++
 src/tools/lucene-cli/docs/demo/index-files.md   |  51 ++++++++
 src/tools/lucene-cli/docs/demo/index.md         |  17 +++
 .../docs/demo/multi-category-lists-facets.md    |  28 ++++
 src/tools/lucene-cli/docs/demo/range-facets.md  |  27 ++++
 src/tools/lucene-cli/docs/demo/search-files.md  |  72 ++++++++++
 src/tools/lucene-cli/docs/demo/simple-facets.md |  27 ++++
 .../docs/demo/simple-sorted-set-facets.md       |  29 +++++
 src/tools/lucene-cli/docs/index.md              |  25 ++++
 src/tools/lucene-cli/docs/index/check.md        |  55 ++++++++
 .../lucene-cli/docs/index/copy-segments.md      |  40 ++++++
 .../lucene-cli/docs/index/delete-segments.md    |  35 +++++
 src/tools/lucene-cli/docs/index/extract-cfs.md  |  42 ++++++
 src/tools/lucene-cli/docs/index/fix.md          |  54 ++++++++
 src/tools/lucene-cli/docs/index/index.md        |  23 ++++
 src/tools/lucene-cli/docs/index/list-cfs.md     |  36 +++++
 .../docs/index/list-high-freq-terms.md          |  49 +++++++
 .../lucene-cli/docs/index/list-segments.md      |  32 +++++
 .../docs/index/list-taxonomy-stats.md           |  38 ++++++
 .../lucene-cli/docs/index/list-term-info.md     |  40 ++++++
 src/tools/lucene-cli/docs/index/merge.md        |  36 +++++
 src/tools/lucene-cli/docs/index/split.md        |  54 ++++++++
 src/tools/lucene-cli/docs/index/upgrade.md      |  52 ++++++++
 src/tools/lucene-cli/docs/lock/index.md         |  10 ++
 src/tools/lucene-cli/docs/lock/stress-test.md   |  55 ++++++++
 src/tools/lucene-cli/docs/lock/verify-server.md |  35 +++++
 46 files changed, 1332 insertions(+), 82 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucenenet/blob/70f15595/src/tools/Lucene.Net.Tests.Cli/Commands/Index/IndexFixCommandTest.cs
----------------------------------------------------------------------
diff --git a/src/tools/Lucene.Net.Tests.Cli/Commands/Index/IndexFixCommandTest.cs b/src/tools/Lucene.Net.Tests.Cli/Commands/Index/IndexFixCommandTest.cs
index 29a2b4c..d153f2d 100644
--- a/src/tools/Lucene.Net.Tests.Cli/Commands/Index/IndexFixCommandTest.cs
+++ b/src/tools/Lucene.Net.Tests.Cli/Commands/Index/IndexFixCommandTest.cs
@@ -64,7 +64,7 @@ namespace Lucene.Net.Cli.Commands
                 AssertCommandTranslation(
                     string.Join(" ", requiredArg.Select(x => x.InputPattern).ToArray()),
                     requiredArg.SelectMany(x => x.Output)
-                    // Special case - the -fix option must be specified when --dry-run is not
+                    // Special case: the -fix option must be specified when --dry-run is not
                     .Concat(new string[] { "-fix" }).ToArray());
             }
 
@@ -74,7 +74,7 @@ namespace Lucene.Net.Cli.Commands
                 {
                     string command = string.Join(" ", requiredArg.Select(x => x.InputPattern).Union(optionalArg.Select(x => x.InputPattern).ToArray()));
                     string[] expected = requiredArg.SelectMany(x => x.Output)
-                        // Special case - the -fix option must be specified when --dry-run is not
+                        // Special case: the -fix option must be specified when --dry-run is not
                         .Concat(command.Contains("--dry-run") ? new string[0] : new string[] { "-fix" })
                         .Union(optionalArg.SelectMany(x => x.Output)).ToArray();
                     AssertCommandTranslation(command, expected);

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/70f15595/src/tools/Lucene.Net.Tests.Cli/Commands/Index/IndexSplitCommandTest.cs
----------------------------------------------------------------------
diff --git a/src/tools/Lucene.Net.Tests.Cli/Commands/Index/IndexSplitCommandTest.cs b/src/tools/Lucene.Net.Tests.Cli/Commands/Index/IndexSplitCommandTest.cs
index c5a9017..a6a1a95 100644
--- a/src/tools/Lucene.Net.Tests.Cli/Commands/Index/IndexSplitCommandTest.cs
+++ b/src/tools/Lucene.Net.Tests.Cli/Commands/Index/IndexSplitCommandTest.cs
@@ -1,5 +1,6 @@
 using NUnit.Framework;
 using System.Collections.Generic;
+using System.Linq;
 
 namespace Lucene.Net.Cli.Commands
 {
@@ -53,6 +54,39 @@ namespace Lucene.Net.Cli.Commands
         }
 
         [Test]
+        public override void TestAllValidCombinations()
+        {
+            var requiredArgs = GetRequiredArgs().ExpandArgs().RequiredParameters();
+            var optionalArgs = GetOptionalArgs().ExpandArgs().OptionalParameters();
+
+            foreach (var requiredArg in requiredArgs)
+            {
+                AssertCommandTranslation(
+                    string.Join(" ", requiredArg.Select(x => x.InputPattern).ToArray()),
+                    requiredArg.SelectMany(x => x.Output)
+                    // Special case: the -num option must be specified when -n is not
+                    // because in MultiPassIndexSplitter it is not optional, so we are patching
+                    // it in our command to make 2 the default.
+                    .Concat(new string[] { "-num", "2" }).ToArray());
+            }
+
+            foreach (var requiredArg in requiredArgs)
+            {
+                foreach (var optionalArg in optionalArgs)
+                {
+                    string command = string.Join(" ", requiredArg.Select(x => x.InputPattern).Union(optionalArg.Select(x => x.InputPattern).ToArray()));
+                    string[] expected = requiredArg.SelectMany(x => x.Output)
+                        // Special case: the -num option must be specified when -n is not
+                        // because in MultiPassIndexSplitter it is not optional, so we are patching
+                        // it in our command to make 2 the default.
+                        .Concat(command.Contains("-n") ? new string[0] : new string[] { "-num", "2" })
+                        .Union(optionalArg.SelectMany(x => x.Output)).ToArray();
+                    AssertCommandTranslation(command, expected);
+                }
+            }
+        }
+
+        [Test]
         public virtual void TestNotEnoughArguments()
         {
             AssertConsoleOutput("", FromResource("NotEnoughArguments", 2));

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/70f15595/src/tools/lucene-cli/Resources/Strings.Designer.cs
----------------------------------------------------------------------
diff --git a/src/tools/lucene-cli/Resources/Strings.Designer.cs b/src/tools/lucene-cli/Resources/Strings.Designer.cs
index cb790ae..5d1fa93 100644
--- a/src/tools/lucene-cli/Resources/Strings.Designer.cs
+++ b/src/tools/lucene-cli/Resources/Strings.Designer.cs
@@ -87,7 +87,7 @@ namespace Lucene.Net.Cli.Resources {
         }
         
         /// <summary>
-        ///    Looks up a localized string similar to The encoding to use for the stemmer table files..
+        ///    Looks up a localized string similar to The encoding to use for the stemmer table files. If not supplied, defaults to UTF-8..
         /// </summary>
         public static string AnalysisStempelCompileStemsCommandStemmerTableFilesEncodingDescription {
             get {
@@ -123,7 +123,7 @@ namespace Lucene.Net.Cli.Resources {
         }
         
         /// <summary>
-        ///    Looks up a localized string similar to The encoding to use for the stemmer table files..
+        ///    Looks up a localized string similar to The encoding to use for the stemmer table files. If not supplied, defaults to UTF-8..
         /// </summary>
         public static string AnalysisStempelPatchStemsCommandStemmerTableFilesEncodingDescription {
             get {
@@ -375,6 +375,17 @@ namespace Lucene.Net.Cli.Resources {
         }
         
         /// <summary>
+        ///    Looks up a localized string similar to Basic tool to check the health of an index. 
+        ///
+        ///As this tool checks every byte in the index, on a large index it can take quite a long time to run..
+        /// </summary>
+        public static string IndexCheckCommandExtendedHelpText {
+            get {
+                return ResourceManager.GetString("IndexCheckCommandExtendedHelpText", resourceCulture);
+            }
+        }
+        
+        /// <summary>
         ///    Looks up a localized string similar to Only check the specified segment(s). This can be specified multiple times, to check more than one segment, eg --segment _2 --segment _a..
         /// </summary>
         public static string IndexCheckCommandSegmentsDescription {
@@ -492,7 +503,7 @@ namespace Lucene.Net.Cli.Resources {
         }
         
         /// <summary>
-        ///    Looks up a localized string similar to Lists sub-files from a .cfs compound file..
+        ///    Looks up a localized string similar to Extracts sub-files from a .cfs compound file..
         /// </summary>
         public static string IndexExtractCfsCommandDescription {
             get {
@@ -501,7 +512,9 @@ namespace Lucene.Net.Cli.Resources {
         }
         
         /// <summary>
-        ///    Looks up a localized string similar to The .cfs compound file format is created using the CompoundFileDirectory from Lucene.Net.Misc..
+        ///    Looks up a localized string similar to Extracts `.cfs` compound files (that were created using the CompoundFileDirectory from Lucene.Net.Misc) to the current working directory.
+        ///
+        ///In order to make the extracted version of the index work, you have to copy the segments file from the compound index into the directory where the extracted files are stored..
         /// </summary>
         public static string IndexExtractCfsCommandExtendedHelpText {
             get {
@@ -528,7 +541,11 @@ namespace Lucene.Net.Cli.Resources {
         }
         
         /// <summary>
-        ///    Looks up a localized string similar to WARNING: This command should only be used on an emergency basis as it will cause documents (perhaps many) to be permanently removed from the index. Always make a backup copy of your index before running this! Do not run this tool on an index that is actively being written to. You have been warned!.
+        ///    Looks up a localized string similar to  Basic tool to check and fix the health of an index and write a new segments file that removes reference to problematic segments.
+        ///
+        ///As this tool checks every byte in the index, on a large index it can take quite a long time to run. 
+        ///
+        ///WARNING: This command should only be used on an emergency basis as it will cause documents (perhaps many) to be permanently removed from the index. Always make a backup copy of your index before running this! Do not run this tool on an index that is actively being written to. [rest of string was truncated]&quot;;.
         /// </summary>
         public static string IndexFixCommandExtendedHelpText {
             get {
@@ -546,7 +563,7 @@ namespace Lucene.Net.Cli.Resources {
         }
         
         /// <summary>
-        ///    Looks up a localized string similar to Extracts sub-files out of a .cfs compound file..
+        ///    Looks up a localized string similar to Lists sub-files out of a .cfs compound file..
         /// </summary>
         public static string IndexListCfsCommandDescription {
             get {
@@ -555,7 +572,7 @@ namespace Lucene.Net.Cli.Resources {
         }
         
         /// <summary>
-        ///    Looks up a localized string similar to The .cfs compound file format is created using the CompoundFileDirectory from Lucene.Net.Misc..
+        ///    Looks up a localized string similar to Prints the filename and size of each file within a given `.cfs` compound file. The .cfs compound file format is created using the CompoundFileDirectory from Lucene.Net.Misc..
         /// </summary>
         public static string IndexListCfsCommandExtendedHelpText {
             get {
@@ -564,7 +581,7 @@ namespace Lucene.Net.Cli.Resources {
         }
         
         /// <summary>
-        ///    Looks up a localized string similar to Extracts the top n most frequent terms by document frequency..
+        ///    Looks up a localized string similar to Lists the top N most frequent terms by document frequency..
         /// </summary>
         public static string IndexListHighFreqTermsCommandDescription {
             get {
@@ -573,7 +590,7 @@ namespace Lucene.Net.Cli.Resources {
         }
         
         /// <summary>
-        ///    Looks up a localized string similar to Extracts the top n most frequent terms (by document frequency) from an index and reports thier document frequency..
+        ///    Looks up a localized string similar to Extracts the top N most frequent terms (by document frequency) from an index and reports thier document frequency..
         /// </summary>
         public static string IndexListHighFreqTermsCommandExtendedHelpText {
             get {
@@ -618,6 +635,15 @@ namespace Lucene.Net.Cli.Resources {
         }
         
         /// <summary>
+        ///    Looks up a localized string similar to After running this command to view segments, use copy-segments to copy segments from one index directory to another or delete-segments to remove segments from an index..
+        /// </summary>
+        public static string IndexListSegmentsExtendedHelpText {
+            get {
+                return ResourceManager.GetString("IndexListSegmentsExtendedHelpText", resourceCulture);
+            }
+        }
+        
+        /// <summary>
         ///    Looks up a localized string similar to Displays the taxonomy statistical information for a taxonomy index..
         /// </summary>
         public static string IndexListTaxonomyStatsCommandDescription {
@@ -627,7 +653,16 @@ namespace Lucene.Net.Cli.Resources {
         }
         
         /// <summary>
-        ///    Looks up a localized string similar to Recursively lists all descendent nodes..
+        ///    Looks up a localized string similar to Prints how many ords are under each dimension..
+        /// </summary>
+        public static string IndexListTaxonomyStatsCommandExtendedHelpText {
+            get {
+                return ResourceManager.GetString("IndexListTaxonomyStatsCommandExtendedHelpText", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///    Looks up a localized string similar to Recursively lists all descendant nodes..
         /// </summary>
         public static string IndexListTaxonomyStatsCommandShowTreeDescription {
             get {
@@ -699,7 +734,7 @@ namespace Lucene.Net.Cli.Resources {
         }
         
         /// <summary>
-        ///    Looks up a localized string similar to Output directory to merge the indexes into..
+        ///    Looks up a localized string similar to The output directory to merge the input indexes into..
         /// </summary>
         public static string IndexMergeCommandOutputDirectoryDescription {
             get {
@@ -717,7 +752,20 @@ namespace Lucene.Net.Cli.Resources {
         }
         
         /// <summary>
-        ///    Looks up a localized string similar to Path to input index. Multiple values can be provided separated by a space..
+        ///    Looks up a localized string similar to  Splits the input index into multiple equal parts. The method employed here uses IndexWriter.AddIndexes(IndexReader[]) where the input data comes from the input index with artificially applied deletes to the document ids that fall outside the selected partition.
+        ///
+        ///Deletes are only applied to a buffered list of deleted documents and don&apos;t affect the source index. This tool works also with read-only indexes.
+        ///
+        ///The disadvantage of this tool is that source index needs to be read as many times as there are part [rest of string was truncated]&quot;;.
+        /// </summary>
+        public static string IndexSplitCommandExtendedHelpText {
+            get {
+                return ResourceManager.GetString("IndexSplitCommandExtendedHelpText", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///    Looks up a localized string similar to The path of the source index, which can have deletions and can have multiple segments (or multiple readers). Multiple values can be supplied separated by a space..
         /// </summary>
         public static string IndexSplitCommandInputDirectoryDescription {
             get {
@@ -726,7 +774,7 @@ namespace Lucene.Net.Cli.Resources {
         }
         
         /// <summary>
-        ///    Looks up a localized string similar to The number of parts to produce..
+        ///    Looks up a localized string similar to The number of parts (output indices) to produce. If omitted, defaults to 2..
         /// </summary>
         public static string IndexSplitCommandNumberOfPartsDescription {
             get {
@@ -744,7 +792,7 @@ namespace Lucene.Net.Cli.Resources {
         }
         
         /// <summary>
-        ///    Looks up a localized string similar to Sequential docid-range split..
+        ///    Looks up a localized string similar to Sequential doc-id range split (default is round-robin)..
         /// </summary>
         public static string IndexSplitCommandSequentialDescription {
             get {
@@ -771,7 +819,11 @@ namespace Lucene.Net.Cli.Resources {
         }
         
         /// <summary>
-        ///    Looks up a localized string similar to  This tool keeps only the last commit in an index; for this reason, if the incoming index has more than one commit, the tool refuses to run by default. Specify --delete-prior-commits to override this, allowing the tool to delete all but the last commit. Specify an FSDirectory implementation through the --directory-type option to force its use. If not qualified by an AssemblyName, the Lucene.Net.dll assembly will be used. WARNING: This tool may reorder document IDs! Also, ensure you are using the correct vers [rest of string was truncated]&quot;;.
+        ///    Looks up a localized string similar to  This tool keeps only the last commit in an index; for this reason, if the incoming index has more than one commit, the tool refuses to run by default. Specify --delete-prior-commits to override this, allowing the tool to delete all but the last commit. 
+        ///
+        ///Specify an FSDirectory implementation through the --directory-type option to force its use. If not qualified by an AssemblyName, the Lucene.Net.dll assembly will be used. 
+        ///
+        ///WARNING: This tool may reorder document IDs! Be sure to make a backup of your in [rest of string was truncated]&quot;;.
         /// </summary>
         public static string IndexUpgradeCommandExtendedHelpText {
             get {
@@ -789,16 +841,7 @@ namespace Lucene.Net.Cli.Resources {
         }
         
         /// <summary>
-        ///    Looks up a localized string similar to Number of locking tries..
-        /// </summary>
-        public static string LockStressTestCommandCountDescription {
-            get {
-                return ResourceManager.GetString("LockStressTestCommandCountDescription", resourceCulture);
-            }
-        }
-        
-        /// <summary>
-        ///    Looks up a localized string similar to Simple standalone tool that forever acquires &amp; releases a lock using a specific LockFactory..
+        ///    Looks up a localized string similar to Simple tool that forever acquires and releases a lock using a specific LockFactory..
         /// </summary>
         public static string LockStressTestCommandDescription {
             get {
@@ -807,7 +850,7 @@ namespace Lucene.Net.Cli.Resources {
         }
         
         /// <summary>
-        ///    Looks up a localized string similar to You should run multiple instances of this process, each with its own unique ID, and each pointing to the same lock directory, to verify that locking is working correctly. Make sure you are first running LockVerifyServer..
+        ///    Looks up a localized string similar to You should run multiple instances of this process, each with its own unique ID, and each pointing to the same lock directory, to verify that locking is working correctly. Make sure you are first running verify-server..
         /// </summary>
         public static string LockStressTestCommandExtendedHelpText {
             get {
@@ -816,7 +859,7 @@ namespace Lucene.Net.Cli.Resources {
         }
         
         /// <summary>
-        ///    Looks up a localized string similar to int value from 0 .. 255 (should be unique for test process)..
+        ///    Looks up a localized string similar to An integer from 0 - 255 (should be unique for test process)..
         /// </summary>
         public static string LockStressTestCommandIDDescription {
             get {
@@ -825,25 +868,25 @@ namespace Lucene.Net.Cli.Resources {
         }
         
         /// <summary>
-        ///    Looks up a localized string similar to Path to the lock directory (only set for Simple/NativeFSLockFactory)..
+        ///    Looks up a localized string similar to The path to the lock directory (only utilized if LOCK_FACTORY_TYPE is set to SimpleFSLockFactory or NativeFSLockFactory)..
         /// </summary>
-        public static string LockStressTestCommandLockFactoryNameDescription {
+        public static string LockStressTestCommandLockDirectoryDescription {
             get {
-                return ResourceManager.GetString("LockStressTestCommandLockFactoryNameDescription", resourceCulture);
+                return ResourceManager.GetString("LockStressTestCommandLockDirectoryDescription", resourceCulture);
             }
         }
         
         /// <summary>
-        ///    Looks up a localized string similar to Primary LockFactory class that we will use..
+        ///    Looks up a localized string similar to The primary LockFactory implementation that we will use..
         /// </summary>
-        public static string LockStressTestCommandLockFactoryTypeNameDescription {
+        public static string LockStressTestCommandLockFactoryTypeDescription {
             get {
-                return ResourceManager.GetString("LockStressTestCommandLockFactoryTypeNameDescription", resourceCulture);
+                return ResourceManager.GetString("LockStressTestCommandLockFactoryTypeDescription", resourceCulture);
             }
         }
         
         /// <summary>
-        ///    Looks up a localized string similar to Milliseconds to pause betweeen each lock obtain/release..
+        ///    Looks up a localized string similar to Milliseconds to pause between each lock obtain/release..
         /// </summary>
         public static string LockStressTestCommandSleepTimeMSDescription {
             get {
@@ -852,7 +895,16 @@ namespace Lucene.Net.Cli.Resources {
         }
         
         /// <summary>
-        ///    Looks up a localized string similar to Port that LockVerifyServer is listening on..
+        ///    Looks up a localized string similar to Number of locking tries..
+        /// </summary>
+        public static string LockStressTestCommandTriesDescription {
+            get {
+                return ResourceManager.GetString("LockStressTestCommandTriesDescription", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///    Looks up a localized string similar to Port that verify-server is listening on..
         /// </summary>
         public static string LockStressTestCommandVerfierPortDescription {
             get {
@@ -861,7 +913,7 @@ namespace Lucene.Net.Cli.Resources {
         }
         
         /// <summary>
-        ///    Looks up a localized string similar to Hostname that LockVerifyServer is listening on..
+        ///    Looks up a localized string similar to Hostname or IP address that verify-server is listening on..
         /// </summary>
         public static string LockStressTestCommandVerifierHostDescription {
             get {
@@ -870,7 +922,7 @@ namespace Lucene.Net.Cli.Resources {
         }
         
         /// <summary>
-        ///    Looks up a localized string similar to Simple standalone server that must be running when you use VerifyingLockFactory. This server verifies at most one process holds the lock at a time..
+        ///    Looks up a localized string similar to Simple server that must be running when you use VerifyingLockFactory (or stress-test). This server verifies at most one process holds the lock at a time..
         /// </summary>
         public static string LockVerifyServerCommandDescription {
             get {
@@ -879,7 +931,7 @@ namespace Lucene.Net.Cli.Resources {
         }
         
         /// <summary>
-        ///    Looks up a localized string similar to Hostname or IP address that LockVerifyServer will listen on..
+        ///    Looks up a localized string similar to Hostname or IP address that verify-server will listen on..
         /// </summary>
         public static string LockVerifyServerCommandIPHostnameDescription {
             get {
@@ -888,7 +940,7 @@ namespace Lucene.Net.Cli.Resources {
         }
         
         /// <summary>
-        ///    Looks up a localized string similar to The maximum number of concurrent clients..
+        ///    Looks up a localized string similar to The maximum number of connected clients..
         /// </summary>
         public static string LockVerifyServerCommandMaxClientsDescription {
             get {

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/70f15595/src/tools/lucene-cli/Resources/Strings.resx
----------------------------------------------------------------------
diff --git a/src/tools/lucene-cli/Resources/Strings.resx b/src/tools/lucene-cli/Resources/Strings.resx
index 2e4ce2a..64be738 100644
--- a/src/tools/lucene-cli/Resources/Strings.resx
+++ b/src/tools/lucene-cli/Resources/Strings.resx
@@ -127,7 +127,7 @@
     <value>The path to a file containing a stemmer table. Multiple values are allowed.</value>
   </data>
   <data name="AnalysisStempelCompileStemsCommandStemmerTableFilesEncodingDescription" xml:space="preserve">
-    <value>The encoding to use for the stemmer table files.</value>
+    <value>The encoding to use for the stemmer table files. If not supplied, defaults to UTF-8.</value>
   </data>
   <data name="AnalysisStempelCompileStemsCommandStemmingAlgorithmDescription" xml:space="preserve">
     <value>The name of the desired stemming algorithm to use.</value>
@@ -139,7 +139,7 @@
     <value>The path to a file containing a stemmer table. Multiple values are allowed.</value>
   </data>
   <data name="AnalysisStempelPatchStemsCommandStemmerTableFilesEncodingDescription" xml:space="preserve">
-    <value>The encoding to use for the stemmer table files.</value>
+    <value>The encoding to use for the stemmer table files. If not supplied, defaults to UTF-8.</value>
   </data>
   <data name="CrossCheckTermVectorsDescription" xml:space="preserve">
     <value>Cross check term vectors.</value>
@@ -222,6 +222,11 @@
   <data name="IndexCheckCommandDescription" xml:space="preserve">
     <value>Checks an index for problematic segments.</value>
   </data>
+  <data name="IndexCheckCommandExtendedHelpText" xml:space="preserve">
+    <value>Basic tool to check the health of an index. 
+
+As this tool checks every byte in the index, on a large index it can take quite a long time to run.</value>
+  </data>
   <data name="IndexCheckCommandSegmentsDescription" xml:space="preserve">
     <value>Only check the specified segment(s). This can be specified multiple times, to check more than one segment, eg --segment _2 --segment _a.</value>
   </data>
@@ -262,10 +267,12 @@
     <value>The .cfs compound file containing words to parse.</value>
   </data>
   <data name="IndexExtractCfsCommandDescription" xml:space="preserve">
-    <value>Lists sub-files from a .cfs compound file.</value>
+    <value>Extracts sub-files from a .cfs compound file.</value>
   </data>
   <data name="IndexExtractCfsCommandExtendedHelpText" xml:space="preserve">
-    <value>The .cfs compound file format is created using the CompoundFileDirectory from Lucene.Net.Misc.</value>
+    <value>Extracts `.cfs` compound files (that were created using the CompoundFileDirectory from Lucene.Net.Misc) to the current working directory.
+
+In order to make the extracted version of the index work, you have to copy the segments file from the compound index into the directory where the extracted files are stored.</value>
   </data>
   <data name="IndexFixCommandDescription" xml:space="preserve">
     <value>Fixes an index by removing problematic segments.</value>
@@ -274,22 +281,26 @@
     <value>Doesn't change the index, but reports any actions that would be taken if this option were not supplied.</value>
   </data>
   <data name="IndexFixCommandExtendedHelpText" xml:space="preserve">
-    <value>WARNING: This command should only be used on an emergency basis as it will cause documents (perhaps many) to be permanently removed from the index. Always make a backup copy of your index before running this! Do not run this tool on an index that is actively being written to. You have been warned!</value>
+    <value>Basic tool to check and fix the health of an index and write a new segments file that removes reference to problematic segments.
+
+As this tool checks every byte in the index, on a large index it can take quite a long time to run. 
+
+WARNING: This command should only be used on an emergency basis as it will cause documents (perhaps many) to be permanently removed from the index. Always make a backup copy of your index before running this! Do not run this tool on an index that is actively being written to. You have been warned!</value>
   </data>
   <data name="IndexListCfsCommandCFSFileNameDescription" xml:space="preserve">
     <value>The .cfs compound file containing words to parse.</value>
   </data>
   <data name="IndexListCfsCommandDescription" xml:space="preserve">
-    <value>Extracts sub-files out of a .cfs compound file.</value>
+    <value>Lists sub-files out of a .cfs compound file.</value>
   </data>
   <data name="IndexListCfsCommandExtendedHelpText" xml:space="preserve">
-    <value>The .cfs compound file format is created using the CompoundFileDirectory from Lucene.Net.Misc.</value>
+    <value>Prints the filename and size of each file within a given `.cfs` compound file. The .cfs compound file format is created using the CompoundFileDirectory from Lucene.Net.Misc.</value>
   </data>
   <data name="IndexListHighFreqTermsCommandDescription" xml:space="preserve">
-    <value>Extracts the top n most frequent terms by document frequency.</value>
+    <value>Lists the top N most frequent terms by document frequency.</value>
   </data>
   <data name="IndexListHighFreqTermsCommandExtendedHelpText" xml:space="preserve">
-    <value>Extracts the top n most frequent terms (by document frequency) from an index and reports thier document frequency.</value>
+    <value>Extracts the top N most frequent terms (by document frequency) from an index and reports thier document frequency.</value>
   </data>
   <data name="IndexListHighFreqTermsCommandFieldDescription" xml:space="preserve">
     <value>The field to consider. If omitted, considers all fields.</value>
@@ -303,11 +314,17 @@
   <data name="IndexListSegmentsCommandDescription" xml:space="preserve">
     <value>Lists segments in an index.</value>
   </data>
+  <data name="IndexListSegmentsExtendedHelpText" xml:space="preserve">
+    <value>After running this command to view segments, use copy-segments to copy segments from one index directory to another or delete-segments to remove segments from an index.</value>
+  </data>
   <data name="IndexListTaxonomyStatsCommandDescription" xml:space="preserve">
     <value>Displays the taxonomy statistical information for a taxonomy index.</value>
   </data>
+  <data name="IndexListTaxonomyStatsCommandExtendedHelpText" xml:space="preserve">
+    <value>Prints how many ords are under each dimension.</value>
+  </data>
   <data name="IndexListTaxonomyStatsCommandShowTreeDescription" xml:space="preserve">
-    <value>Recursively lists all descendent nodes.</value>
+    <value>Recursively lists all descendant nodes.</value>
   </data>
   <data name="IndexListTermInfoCommandDescription" xml:space="preserve">
     <value>Gets document frequency and total number of occurrences of a term.</value>
@@ -331,22 +348,31 @@
     <value>Two or more source index directories separated by a space.</value>
   </data>
   <data name="IndexMergeCommandOutputDirectoryDescription" xml:space="preserve">
-    <value>Output directory to merge the indexes into.</value>
+    <value>The output directory to merge the input indexes into.</value>
   </data>
   <data name="IndexSplitCommandDescription" xml:space="preserve">
     <value>Splits an index into multiple parts.</value>
   </data>
+  <data name="IndexSplitCommandExtendedHelpText" xml:space="preserve">
+    <value>Splits the input index into multiple equal parts. The method employed here uses IndexWriter.AddIndexes(IndexReader[]) where the input data comes from the input index with artificially applied deletes to the document ids that fall outside the selected partition.
+
+Deletes are only applied to a buffered list of deleted documents and don't affect the source index. This tool works also with read-only indexes.
+
+The disadvantage of this tool is that source index needs to be read as many times as there are parts to be created. The multiple passes may be slow.
+
+NOTE: This tool is unaware of documents added automatically via IndexWriter.AddDocuments(IEnumerable&lt;IEnumerable&lt;IIndexableField&gt;&gt;, Analyzer) or IndexWriter.UpdateDocuments(Term, IEnumerable&lt;IEnumerable&lt;IIndexableField&gt;&gt;, Analyzer), which means it can easily break up such document groups.</value>
+  </data>
   <data name="IndexSplitCommandInputDirectoryDescription" xml:space="preserve">
-    <value>Path to input index. Multiple values can be provided separated by a space.</value>
+    <value>The path of the source index, which can have deletions and can have multiple segments (or multiple readers). Multiple values can be supplied separated by a space.</value>
   </data>
   <data name="IndexSplitCommandNumberOfPartsDescription" xml:space="preserve">
-    <value>The number of parts to produce.</value>
+    <value>The number of parts (output indices) to produce. If omitted, defaults to 2.</value>
   </data>
   <data name="IndexSplitCommandOutputDirectoryDescription" xml:space="preserve">
     <value>Path to output directory to contain partial indexes.</value>
   </data>
   <data name="IndexSplitCommandSequentialDescription" xml:space="preserve">
-    <value>Sequential docid-range split.</value>
+    <value>Sequential doc-id range split (default is round-robin).</value>
   </data>
   <data name="IndexUpgradeCommandDeleteDescription" xml:space="preserve">
     <value>Deletes prior commits.</value>
@@ -355,46 +381,50 @@
     <value>Upgrades all segments of an index from previous Lucene.Net versions to the current segment file format.</value>
   </data>
   <data name="IndexUpgradeCommandExtendedHelpText" xml:space="preserve">
-    <value>This tool keeps only the last commit in an index; for this reason, if the incoming index has more than one commit, the tool refuses to run by default. Specify --delete-prior-commits to override this, allowing the tool to delete all but the last commit. Specify an FSDirectory implementation through the --directory-type option to force its use. If not qualified by an AssemblyName, the Lucene.Net.dll assembly will be used. WARNING: This tool may reorder document IDs! Also, ensure you are using the correct version of this utility to match your application's version of Lucene.Net.</value>
+    <value>This tool keeps only the last commit in an index; for this reason, if the incoming index has more than one commit, the tool refuses to run by default. Specify --delete-prior-commits to override this, allowing the tool to delete all but the last commit. 
+
+Specify an FSDirectory implementation through the --directory-type option to force its use. If not qualified by an AssemblyName, the Lucene.Net.dll assembly will be used. 
+
+WARNING: This tool may reorder document IDs! Be sure to make a backup of your index before you use this. Also, ensure you are using the correct version of this utility to match your application's version of Lucene.Net. This operation cannot be reversed.</value>
   </data>
   <data name="LockCommandDescription" xml:space="preserve">
     <value>Utilities for verifying concurrent locking integrity.</value>
   </data>
-  <data name="LockStressTestCommandCountDescription" xml:space="preserve">
-    <value>Number of locking tries.</value>
-  </data>
   <data name="LockStressTestCommandDescription" xml:space="preserve">
-    <value>Simple standalone tool that forever acquires &amp; releases a lock using a specific LockFactory.</value>
+    <value>Simple tool that forever acquires and releases a lock using a specific LockFactory.</value>
   </data>
   <data name="LockStressTestCommandExtendedHelpText" xml:space="preserve">
-    <value>You should run multiple instances of this process, each with its own unique ID, and each pointing to the same lock directory, to verify that locking is working correctly. Make sure you are first running LockVerifyServer.</value>
+    <value>You should run multiple instances of this process, each with its own unique ID, and each pointing to the same lock directory, to verify that locking is working correctly. Make sure you are first running verify-server.</value>
   </data>
   <data name="LockStressTestCommandIDDescription" xml:space="preserve">
-    <value>int value from 0 .. 255 (should be unique for test process).</value>
+    <value>An integer from 0 - 255 (should be unique for test process).</value>
   </data>
-  <data name="LockStressTestCommandLockFactoryNameDescription" xml:space="preserve">
-    <value>Path to the lock directory (only set for Simple/NativeFSLockFactory).</value>
+  <data name="LockStressTestCommandLockDirectoryDescription" xml:space="preserve">
+    <value>The path to the lock directory (only utilized if LOCK_FACTORY_TYPE is set to SimpleFSLockFactory or NativeFSLockFactory).</value>
   </data>
-  <data name="LockStressTestCommandLockFactoryTypeNameDescription" xml:space="preserve">
-    <value>Primary LockFactory class that we will use.</value>
+  <data name="LockStressTestCommandLockFactoryTypeDescription" xml:space="preserve">
+    <value>The primary LockFactory implementation that we will use.</value>
   </data>
   <data name="LockStressTestCommandSleepTimeMSDescription" xml:space="preserve">
-    <value>Milliseconds to pause betweeen each lock obtain/release.</value>
+    <value>Milliseconds to pause between each lock obtain/release.</value>
+  </data>
+  <data name="LockStressTestCommandTriesDescription" xml:space="preserve">
+    <value>Number of locking tries.</value>
   </data>
   <data name="LockStressTestCommandVerfierPortDescription" xml:space="preserve">
-    <value>Port that LockVerifyServer is listening on.</value>
+    <value>Port that verify-server is listening on.</value>
   </data>
   <data name="LockStressTestCommandVerifierHostDescription" xml:space="preserve">
-    <value>Hostname that LockVerifyServer is listening on.</value>
+    <value>Hostname or IP address that verify-server is listening on.</value>
   </data>
   <data name="LockVerifyServerCommandDescription" xml:space="preserve">
-    <value>Simple standalone server that must be running when you use VerifyingLockFactory. This server verifies at most one process holds the lock at a time.</value>
+    <value>Simple server that must be running when you use VerifyingLockFactory (or stress-test). This server verifies at most one process holds the lock at a time.</value>
   </data>
   <data name="LockVerifyServerCommandIPHostnameDescription" xml:space="preserve">
-    <value>Hostname or IP address that LockVerifyServer will listen on.</value>
+    <value>Hostname or IP address that verify-server will listen on.</value>
   </data>
   <data name="LockVerifyServerCommandMaxClientsDescription" xml:space="preserve">
-    <value>The maximum number of concurrent clients.</value>
+    <value>The maximum number of connected clients.</value>
   </data>
   <data name="NotEnoughArguments" xml:space="preserve">
     <value>{0} arguments are required.</value>

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/70f15595/src/tools/lucene-cli/arguments/SegmentsArgument.cs
----------------------------------------------------------------------
diff --git a/src/tools/lucene-cli/arguments/SegmentsArgument.cs b/src/tools/lucene-cli/arguments/SegmentsArgument.cs
index bf6b0c9..d7a406a 100644
--- a/src/tools/lucene-cli/arguments/SegmentsArgument.cs
+++ b/src/tools/lucene-cli/arguments/SegmentsArgument.cs
@@ -23,7 +23,7 @@ namespace Lucene.Net.Cli
     {
         public SegmentsArgument()
         {
-            Name = "<SEGMENT>[ [<SEGMENT_2] ...[<SEGMENT_N>]]";
+            Name = "<SEGMENT>[ <SEGMENT_2>...]";
             Description = Resources.Strings.SegmentsArgumentDescription;
             MultipleValues = true;
         }

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/70f15595/src/tools/lucene-cli/commands/index/index-check/IndexCheckCommand.cs
----------------------------------------------------------------------
diff --git a/src/tools/lucene-cli/commands/index/index-check/IndexCheckCommand.cs b/src/tools/lucene-cli/commands/index/index-check/IndexCheckCommand.cs
index 11d9e96..5f216af 100644
--- a/src/tools/lucene-cli/commands/index/index-check/IndexCheckCommand.cs
+++ b/src/tools/lucene-cli/commands/index/index-check/IndexCheckCommand.cs
@@ -37,6 +37,7 @@ namespace Lucene.Net.Cli
 
                 this.Name = "check";
                 this.Description = FromResource("Description");
+                this.ExtendedHelpText = FromResource("ExtendedHelpText");
 
                 this.Arguments.Add(new IndexDirectoryArgument());
                 this.Options.Add(new VerboseOption());

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/70f15595/src/tools/lucene-cli/commands/index/index-copy-segments/IndexCopySegmentsCommand.cs
----------------------------------------------------------------------
diff --git a/src/tools/lucene-cli/commands/index/index-copy-segments/IndexCopySegmentsCommand.cs b/src/tools/lucene-cli/commands/index/index-copy-segments/IndexCopySegmentsCommand.cs
index 47caa63..d5aa62b 100644
--- a/src/tools/lucene-cli/commands/index/index-copy-segments/IndexCopySegmentsCommand.cs
+++ b/src/tools/lucene-cli/commands/index/index-copy-segments/IndexCopySegmentsCommand.cs
@@ -29,13 +29,12 @@ namespace Lucene.Net.Cli
 
                 this.Name = "copy-segments";
                 this.Description = FromResource("Description");
+                this.ExtendedHelpText = FromResource("ExtendedHelpText");
 
                 this.Argument("<INPUT_DIRECTORY>", FromResource("InputDirectoryDescription"));
                 this.Argument("<OUTPUT_DIRECTORY>", FromResource("OutputDirectoryDescription"));
                 this.Arguments.Add(new SegmentsArgument() { Description = FromResource("SegmentsDescription") });
 
-                this.ExtendedHelpText = FromResource("ExtendedHelpText");
-
                 this.OnExecute(() => new IndexCopySegmentsCommand().Run(this));
             }
         }

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/70f15595/src/tools/lucene-cli/commands/index/index-extract-cfs/IndexExtractCfsCommand.cs
----------------------------------------------------------------------
diff --git a/src/tools/lucene-cli/commands/index/index-extract-cfs/IndexExtractCfsCommand.cs b/src/tools/lucene-cli/commands/index/index-extract-cfs/IndexExtractCfsCommand.cs
index 874f6a6..97f7b99 100644
--- a/src/tools/lucene-cli/commands/index/index-extract-cfs/IndexExtractCfsCommand.cs
+++ b/src/tools/lucene-cli/commands/index/index-extract-cfs/IndexExtractCfsCommand.cs
@@ -30,6 +30,7 @@ namespace Lucene.Net.Cli
 
                 this.Name = "extract-cfs";
                 this.Description = FromResource("Description");
+                this.ExtendedHelpText = FromResource("ExtendedHelpText");
 
                 this.Argument("<CFS_FILE_NAME>", FromResource("CFSFileNameDescription"));
                 this.Options.Add(new DirectoryTypeOption());

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/70f15595/src/tools/lucene-cli/commands/index/index-list-cfs/IndexListCfsCommand.cs
----------------------------------------------------------------------
diff --git a/src/tools/lucene-cli/commands/index/index-list-cfs/IndexListCfsCommand.cs b/src/tools/lucene-cli/commands/index/index-list-cfs/IndexListCfsCommand.cs
index 4b05cbb..2084649 100644
--- a/src/tools/lucene-cli/commands/index/index-list-cfs/IndexListCfsCommand.cs
+++ b/src/tools/lucene-cli/commands/index/index-list-cfs/IndexListCfsCommand.cs
@@ -37,6 +37,7 @@ namespace Lucene.Net.Cli
 
                 this.Name = "list-cfs";
                 this.Description = FromResource("Description");
+                this.ExtendedHelpText = FromResource("ExtendedHelpText");
 
                 this.Argument("<CFS_FILE_NAME>", FromResource("CFSFileNameDescription"));
                 this.Options.Add(new DirectoryTypeOption());

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/70f15595/src/tools/lucene-cli/commands/index/index-list-high-freq-terms/IndexListHighFreqTerms.cs
----------------------------------------------------------------------
diff --git a/src/tools/lucene-cli/commands/index/index-list-high-freq-terms/IndexListHighFreqTerms.cs b/src/tools/lucene-cli/commands/index/index-list-high-freq-terms/IndexListHighFreqTerms.cs
index ced2b9d..c4367ea 100644
--- a/src/tools/lucene-cli/commands/index/index-list-high-freq-terms/IndexListHighFreqTerms.cs
+++ b/src/tools/lucene-cli/commands/index/index-list-high-freq-terms/IndexListHighFreqTerms.cs
@@ -38,7 +38,7 @@ namespace Lucene.Net.Cli
                     FromResource("TotalTermFrequencyDescription"),
                     CommandOptionType.NoValue);
                 this.NumberOfTermsOption = this.Option(
-                    "-n|--number-of-terms <NUMBER_OF_TERMS>",
+                    "-n|--number-of-terms <NUMBER>",
                     FromResource("NumberOfTermsDescription"),
                     CommandOptionType.SingleValue);
                 this.FieldOption = this.Option(

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/70f15595/src/tools/lucene-cli/commands/index/index-list-segments/IndexSegmentListCommand.cs
----------------------------------------------------------------------
diff --git a/src/tools/lucene-cli/commands/index/index-list-segments/IndexSegmentListCommand.cs b/src/tools/lucene-cli/commands/index/index-list-segments/IndexSegmentListCommand.cs
index ca4d2dc..1e636b5 100644
--- a/src/tools/lucene-cli/commands/index/index-list-segments/IndexSegmentListCommand.cs
+++ b/src/tools/lucene-cli/commands/index/index-list-segments/IndexSegmentListCommand.cs
@@ -30,6 +30,7 @@ namespace Lucene.Net.Cli
 
                 this.Name = "list-segments";
                 this.Description = FromResource("Description");
+                this.ExtendedHelpText = FromResource("ExtendedHelpText");
 
                 this.Arguments.Add(new IndexDirectoryArgument());
 

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/70f15595/src/tools/lucene-cli/commands/index/index-list-taxonomy-stats/IndexListTaxonomyStatsCommand.cs
----------------------------------------------------------------------
diff --git a/src/tools/lucene-cli/commands/index/index-list-taxonomy-stats/IndexListTaxonomyStatsCommand.cs b/src/tools/lucene-cli/commands/index/index-list-taxonomy-stats/IndexListTaxonomyStatsCommand.cs
index ad985d8..ad4772c 100644
--- a/src/tools/lucene-cli/commands/index/index-list-taxonomy-stats/IndexListTaxonomyStatsCommand.cs
+++ b/src/tools/lucene-cli/commands/index/index-list-taxonomy-stats/IndexListTaxonomyStatsCommand.cs
@@ -31,6 +31,7 @@ namespace Lucene.Net.Cli
 
                 this.Name = "list-taxonomy-stats";
                 this.Description = FromResource("Description");
+                this.ExtendedHelpText = FromResource("ExtendedHelpText");
 
                 this.Arguments.Add(new IndexDirectoryArgument());
                 this.ShowTreeOption = this.Option("-tree|--show-tree", FromResource("ShowTreeDescription"), CommandOptionType.NoValue);

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/70f15595/src/tools/lucene-cli/commands/index/index-list-term-info/IndexListTermInfoCommand.cs
----------------------------------------------------------------------
diff --git a/src/tools/lucene-cli/commands/index/index-list-term-info/IndexListTermInfoCommand.cs b/src/tools/lucene-cli/commands/index/index-list-term-info/IndexListTermInfoCommand.cs
index 780e8d1..688372a 100644
--- a/src/tools/lucene-cli/commands/index/index-list-term-info/IndexListTermInfoCommand.cs
+++ b/src/tools/lucene-cli/commands/index/index-list-term-info/IndexListTermInfoCommand.cs
@@ -29,6 +29,7 @@ namespace Lucene.Net.Cli
 
                 this.Name = "list-term-info";
                 this.Description = FromResource("Description");
+                this.ExtendedHelpText = FromResource("ExtendedHelpText");
 
                 this.Arguments.Add(new IndexDirectoryArgument(required: true) { Description = FromResource("IndexDirectoryDescription") });
                 this.Argument("<FIELD>", FromResource("FieldDescription"));

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/70f15595/src/tools/lucene-cli/commands/index/index-split/IndexSplitCommand.cs
----------------------------------------------------------------------
diff --git a/src/tools/lucene-cli/commands/index/index-split/IndexSplitCommand.cs b/src/tools/lucene-cli/commands/index/index-split/IndexSplitCommand.cs
index 80bd2eb..b8cc60e 100644
--- a/src/tools/lucene-cli/commands/index/index-split/IndexSplitCommand.cs
+++ b/src/tools/lucene-cli/commands/index/index-split/IndexSplitCommand.cs
@@ -60,11 +60,17 @@ namespace Lucene.Net.Cli
 
             var input = cmd as Configuration;
 
+            args.Add("-num");
+
             if (input.NumberOfParts != null && input.NumberOfParts.HasValue())
             {
-                args.Add("-num");
                 args.Add(input.NumberOfParts.Value());
             }
+            else
+            {
+                // Default to 2 parts
+                args.Add("2");
+            }
 
             if (input.Sequential != null && input.Sequential.HasValue())
             {

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/70f15595/src/tools/lucene-cli/commands/lock/lock-stress-test/LockStressTestCommand.cs
----------------------------------------------------------------------
diff --git a/src/tools/lucene-cli/commands/lock/lock-stress-test/LockStressTestCommand.cs b/src/tools/lucene-cli/commands/lock/lock-stress-test/LockStressTestCommand.cs
index 9b0f908..199ad08 100644
--- a/src/tools/lucene-cli/commands/lock/lock-stress-test/LockStressTestCommand.cs
+++ b/src/tools/lucene-cli/commands/lock/lock-stress-test/LockStressTestCommand.cs
@@ -29,16 +29,15 @@ namespace Lucene.Net.Cli
 
                 this.Name = "stress-test";
                 this.Description = FromResource("Description");
+                this.ExtendedHelpText = FromResource("ExtendedHelpText");
 
                 this.Argument("<ID>", FromResource("IDDescription"));
                 this.Argument("<VERIFIER_HOST>", FromResource("VerifierHostDescription"));
                 this.Argument("<VERIFIER_PORT>", FromResource("VerfierPortDescription"));
-                this.Argument("<LOCK_FACTORY_TYPENAME>", FromResource("LockFactoryTypeNameDescription"));
-                this.Argument("<LOCK_DIRECTORY_NAME>", FromResource("LockFactoryNameDescription"));
+                this.Argument("<LOCK_FACTORY_TYPE>", FromResource("LockFactoryTypeDescription"));
+                this.Argument("<LOCK_DIRECTORY>", FromResource("LockDirectoryDescription"));
                 this.Argument("<SLEEP_TIME_MS>", FromResource("SleepTimeMSDescription"));
-                this.Argument("<COUNT>", FromResource("CountDescription"));
-
-                this.ExtendedHelpText = FromResource("ExtendedHelpText");
+                this.Argument("<TRIES>", FromResource("TriesDescription"));
 
                 this.OnExecute(() => new LockStressTestCommand().Run(this));
             }

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/70f15595/src/tools/lucene-cli/docs/analysis/index.md
----------------------------------------------------------------------
diff --git a/src/tools/lucene-cli/docs/analysis/index.md b/src/tools/lucene-cli/docs/analysis/index.md
new file mode 100644
index 0000000..c114294
--- /dev/null
+++ b/src/tools/lucene-cli/docs/analysis/index.md
@@ -0,0 +1,10 @@
+# analysis
+
+## Description
+
+Utilities to manage specialized analyzers.
+
+## Commands
+
+- [stempel-compile-stems](stempel-compile-stems.md)
+- [stempel-patch-stems](stempel-patch-stems.md)
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/70f15595/src/tools/lucene-cli/docs/analysis/stempel-compile-stems.md
----------------------------------------------------------------------
diff --git a/src/tools/lucene-cli/docs/analysis/stempel-compile-stems.md b/src/tools/lucene-cli/docs/analysis/stempel-compile-stems.md
new file mode 100644
index 0000000..6aae62c
--- /dev/null
+++ b/src/tools/lucene-cli/docs/analysis/stempel-compile-stems.md
@@ -0,0 +1,37 @@
+# stempel-compile-stems
+
+### Name
+
+`analysis-stempel-compile-stems` - Compiles a stemmer table for the Egothor stemmer in the Lucene.Net.Analysis.Stempel project.
+
+### Synopsis
+
+<code>dotnet lucene-cli.dll analysis stempel-compile-stems <STEMMING_ALGORITHM> <STEMMER_TABLE_FILE> [-e|--encoding] [?|-h|--help]</code>
+
+### Description
+
+See the [Egothor project documentation](http://egothor.sourceforge.net/) for more information.
+
+### Arguments
+
+`STEMMING_ALGORITHM`
+
+The name of the desired stemming algorithm to use. Possible values are `Multi` (which changes the stemmer to use the  MultiTrie2 rather than a Trie class to store its data) or `0` which instructs the stemmer to store the original data. Any other supplied value will use the default algorithm. See the [Egothor project documentation](http://egothor.sourceforge.net/) for more information.
+
+`STEMMER_TABLE_FILE`
+
+The path to a file containing a stemmer table. Multiple values can be supplied separated by a space.
+
+### Options
+
+`?|-h|--help`
+
+Prints out a short help for the command.
+
+`-e|--encoding <ENCODING>`
+
+The file encoding used by the stemmer files. If not supplied, the default value is `UTF-8`. Note this value can alternatively be supplied by setting the environment variable `egothor.stemmer.charset`.
+
+### Example
+
+<code>dotnet lucene-cli.dll analysis stempel-compile-stems test X:\stemmer-data\table1.txt X:\stemmer-data\table2.txt</code>

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/70f15595/src/tools/lucene-cli/docs/analysis/stempel-patch-stems.md
----------------------------------------------------------------------
diff --git a/src/tools/lucene-cli/docs/analysis/stempel-patch-stems.md b/src/tools/lucene-cli/docs/analysis/stempel-patch-stems.md
new file mode 100644
index 0000000..9b4ce4a
--- /dev/null
+++ b/src/tools/lucene-cli/docs/analysis/stempel-patch-stems.md
@@ -0,0 +1,34 @@
+# stempel-patch-stems
+
+### Name
+
+`analysis-stempel-patch-stems` - Generates patch commands from an already prepared stemmer table for the Egothor stemmer in the Lucene.Net.Analysis.Stempel project.
+
+### Synopsis
+
+<code>dotnet lucene-cli.dll analysis stempel-patch-stems <STEMMER_TABLE_FILE> [-e|--encoding] [?|-h|--help]</code>
+
+### Description
+
+See the [Egothor project documentation](http://egothor.sourceforge.net/) for more information.
+
+### Arguments
+
+`STEMMER_TABLE_FILE`
+
+The path to a file containing a stemmer table. Multiple values can be supplied separated by a space.
+
+### Options
+
+`?|-h|--help`
+
+Prints out a short help for the command.
+
+`-e|--encoding <ENCODING>`
+
+The file encoding used by the stemmer files. If not supplied, the default value is `UTF-8`. Note this value can alternatively be supplied by setting the environment variable `egothor.stemmer.charset`.
+
+### Example
+
+<code>dotnet lucene-cli.dll analysis stempel-patch-stems X:\stemmer-data\table1.txt X:\stemmer-data\table2.txt --encoding UTF-16</code>
+

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/70f15595/src/tools/lucene-cli/docs/demo/associations-facets.md
----------------------------------------------------------------------
diff --git a/src/tools/lucene-cli/docs/demo/associations-facets.md b/src/tools/lucene-cli/docs/demo/associations-facets.md
new file mode 100644
index 0000000..77b10fe
--- /dev/null
+++ b/src/tools/lucene-cli/docs/demo/associations-facets.md
@@ -0,0 +1,27 @@
+# associations-facets
+
+### Name
+
+`demo-associations-facets` - Shows example usage of category associations.
+
+### Synopsis
+
+<code>dotnet lucene-cli.dll demo associations-facets [-src|--view-source-code] [-out|--output-source-code] [?|-h|--help]</code>
+
+### Options
+
+`?|-h|--help`
+
+Prints out a short help for the command.
+
+`-src|--view-source-code`
+
+Prints the source code to the console. Use `SPACE` or `n` to move to the next page of text, `ENTER` to scroll to the next line of text, `q` or `x` to quit.
+
+`-out|--output-source-code <DIRECTORY>`
+
+Outputs the source code to the specified directory.
+
+### Example
+
+<code>dotnet lucene-cli.dll demo associations-facets</code>

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/70f15595/src/tools/lucene-cli/docs/demo/distance-facets.md
----------------------------------------------------------------------
diff --git a/src/tools/lucene-cli/docs/demo/distance-facets.md b/src/tools/lucene-cli/docs/demo/distance-facets.md
new file mode 100644
index 0000000..abfdf3a
--- /dev/null
+++ b/src/tools/lucene-cli/docs/demo/distance-facets.md
@@ -0,0 +1,27 @@
+# distance-facets
+
+### Name
+
+`demo-distance-facets` - Shows simple usage of dynamic range faceting, using the expressions module to calculate distance.
+
+### Synopsis
+
+<code>dotnet lucene-cli.dll demo distance-facets [-src|--view-source-code] [-out|--output-source-code] [?|-h|--help]</code>
+
+### Options
+
+`?|-h|--help`
+
+Prints out a short help for the command.
+
+`-src|--view-source-code`
+
+Prints the source code to the console. Use `SPACE` or `n` to move to the next page of text, `ENTER` to scroll to the next line of text, `q` or `x` to quit.
+
+`-out|--output-source-code <DIRECTORY>`
+
+Outputs the source code to the specified directory.
+
+### Example
+
+<code>dotnet lucene-cli.dll demo distance-facets</code>

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/70f15595/src/tools/lucene-cli/docs/demo/expression-aggregation-facets.md
----------------------------------------------------------------------
diff --git a/src/tools/lucene-cli/docs/demo/expression-aggregation-facets.md b/src/tools/lucene-cli/docs/demo/expression-aggregation-facets.md
new file mode 100644
index 0000000..8633982
--- /dev/null
+++ b/src/tools/lucene-cli/docs/demo/expression-aggregation-facets.md
@@ -0,0 +1,27 @@
+# expression-aggregation-facets
+
+### Name
+
+`demo-expression-aggregation-facets` - Shows facets aggregation by an expression.
+
+### Synopsis
+
+<code>dotnet lucene-cli.dll demo expression-aggregation-facets [-src|--view-source-code] [-out|--output-source-code] [?|-h|--help]</code>
+
+### Options
+
+`?|-h|--help`
+
+Prints out a short help for the command.
+
+`-src|--view-source-code`
+
+Prints the source code to the console. Use `SPACE` or `n` to move to the next page of text, `ENTER` to scroll to the next line of text, `q` or `x` to quit.
+
+`-out|--output-source-code <DIRECTORY>`
+
+Outputs the source code to the specified directory.
+
+### Example
+
+<code>dotnet lucene-cli.dll demo expression-aggregation-facets</code>

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/70f15595/src/tools/lucene-cli/docs/demo/index-files.md
----------------------------------------------------------------------
diff --git a/src/tools/lucene-cli/docs/demo/index-files.md b/src/tools/lucene-cli/docs/demo/index-files.md
new file mode 100644
index 0000000..10d1806
--- /dev/null
+++ b/src/tools/lucene-cli/docs/demo/index-files.md
@@ -0,0 +1,51 @@
+# index-files
+
+### Name
+
+`demo-index-files` - Index all files under a directory.
+
+### Synopsis
+
+```
+dotnet lucene-cli.dll demo index-files <INDEX_DIRECTORY> <SOURCE_DIRECTORY> [-u|--update] [?|-h|--help]
+dotnet lucene-cli.dll demo index-files [-src|--view-source-code] [-out|--output-source-code]
+```
+
+### Description
+
+This demo can be used to learn how to build a Lucene.Net index. After the index has been built, you can run the [search-files demo](search-files.md) to run queries against it.
+
+### Arguments
+
+`INDEX_DIRECTORY`
+
+The directory of the index.
+
+`SOURCE_DIRECTORY`
+
+The source directory containing the files to index. This directory will be analyzed recursively.
+
+### Options
+
+`?|-h|--help`
+
+Prints out a short help for the command.
+
+`-u|--update`
+
+Adds new documents to an existing index. If not supplied, any existing index in the `INDEX_DIRECTORY` will be overwritten.
+
+`-src|--view-source-code`
+
+Prints the source code to the console. Use `SPACE` or `n` to move to the next page of text, `ENTER` to scroll to the next line of text, `q` or `x` to quit.
+
+`-out|--output-source-code <DIRECTORY>`
+
+Outputs the source code to the specified directory.
+
+### Example
+
+Indexes the contents of `C:\Users\BGates\Documents\` and places the Lucene.Net index in `X:\test-index\`.
+
+<code>dotnet lucene-cli.dll demo index-files X:\test-index C:\Users\BGates\Documents</code>
+

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/70f15595/src/tools/lucene-cli/docs/demo/index.md
----------------------------------------------------------------------
diff --git a/src/tools/lucene-cli/docs/demo/index.md b/src/tools/lucene-cli/docs/demo/index.md
new file mode 100644
index 0000000..27f4ec1
--- /dev/null
+++ b/src/tools/lucene-cli/docs/demo/index.md
@@ -0,0 +1,17 @@
+# demo
+
+## Description
+
+Demos for various Lucene.Net functionality including C# code samples.
+
+## Commands
+
+- [associations-facets](associations-facets.md)
+- [distance-facets](distance-facets.md)
+- [expression-aggregation-facets](expression-aggregation-facets.md)
+- [index-files](index-files.md)
+- [multi-category-lists-facets](multi-category-lists-facets.md)
+- [range-facets](range-facets.md)
+- [search-files](search-files.md)
+- [simple-facets](simple-facets.md)
+- [simple-sorted-set-facets](simple-sorted-set-facets.md)
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/70f15595/src/tools/lucene-cli/docs/demo/multi-category-lists-facets.md
----------------------------------------------------------------------
diff --git a/src/tools/lucene-cli/docs/demo/multi-category-lists-facets.md b/src/tools/lucene-cli/docs/demo/multi-category-lists-facets.md
new file mode 100644
index 0000000..f486c2a
--- /dev/null
+++ b/src/tools/lucene-cli/docs/demo/multi-category-lists-facets.md
@@ -0,0 +1,28 @@
+# multi-category-lists-facets
+
+### Name
+
+`demo-multi-category-lists-facets` - Demonstrates indexing categories into different indexed fields.
+
+### Synopsis
+
+<code>dotnet lucene-cli.dll demo multi-category-lists-facets [-src|--view-source-code] [-out|--output-source-code] [?|-h|--help]</code>
+
+### Options
+
+`?|-h|--help`
+
+Prints out a short help for the command.
+
+`-src|--view-source-code`
+
+Prints the source code to the console. Use `SPACE` or `n` to move to the next page of text, `ENTER` to scroll to the next line of text, `q` or `x` to quit.
+
+`-out|--output-source-code <DIRECTORY>`
+
+Outputs the source code to the specified directory.
+
+
+### Example
+
+<code>dotnet lucene-cli.dll demo multi-category-lists-facets</code>

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/70f15595/src/tools/lucene-cli/docs/demo/range-facets.md
----------------------------------------------------------------------
diff --git a/src/tools/lucene-cli/docs/demo/range-facets.md b/src/tools/lucene-cli/docs/demo/range-facets.md
new file mode 100644
index 0000000..09e392e
--- /dev/null
+++ b/src/tools/lucene-cli/docs/demo/range-facets.md
@@ -0,0 +1,27 @@
+# range-facets
+
+### Name
+
+`demo-range-facets` - Shows simple usage of dynamic range faceting.
+
+### Synopsis
+
+<code>dotnet lucene-cli.dll demo range-facets [-src|--view-source-code] [-out|--output-source-code] [?|-h|--help]</code>
+
+### Options
+
+`?|-h|--help`
+
+Prints out a short help for the command.
+
+`-src|--view-source-code`
+
+Prints the source code to the console. Use `SPACE` or `n` to move to the next page of text, `ENTER` to scroll to the next line of text, `q` or `x` to quit.
+
+`-out|--output-source-code <DIRECTORY>`
+
+Outputs the source code to the specified directory.
+
+### Example
+
+<code>dotnet lucene-cli.dll demo range-facets</code>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/70f15595/src/tools/lucene-cli/docs/demo/search-files.md
----------------------------------------------------------------------
diff --git a/src/tools/lucene-cli/docs/demo/search-files.md b/src/tools/lucene-cli/docs/demo/search-files.md
new file mode 100644
index 0000000..3bbfe38
--- /dev/null
+++ b/src/tools/lucene-cli/docs/demo/search-files.md
@@ -0,0 +1,72 @@
+# search-files
+
+### Name
+
+`demo-search-files` - Simple command-line based search demo.
+
+### Synopsis
+
+```
+dotnet lucene-cli.dll demo search-files <INDEX_DIRECTORY> [-f|--field] [-r|--repeat] [-qf|--queries-file] [-q|--query] [--raw] [-p|--page-size] [?|-h|--help]
+dotnet lucene-cli.dll demo search-files [-src|--view-source-code] [-out|--output-source-code]
+```
+
+### Description
+
+Run the [index-files demo](index-files.md) first to generate an index to search.
+
+> NOTE: To run queries interactively in the console, omit both the `--queries-file` and the `--query` arguments.
+
+### Arguments
+
+`INDEX_DIRECTORY`
+
+The directory of the index that has previously been created using the [index-files demo](index-files.md).
+
+### Options
+
+`?|-h|--help`
+
+Prints out a short help for the command.
+
+`-f|--field <FIELD>`
+
+The index field to use in the search. If not supplied, defaults to `contents`.
+
+`-r|--repeat <NUMBER>`
+
+Repeat the search and time as a benchmark.
+
+`-qf|--queries-file <PATH>`
+
+A file containing the queries to perform.
+
+`-q|--query <QUERY>`
+
+A query to perform.
+
+`--raw`
+
+Output raw format.
+
+`-p|--page-size <NUMBER>`
+
+Hits per page to display.
+
+`-src|--view-source-code`
+
+Prints the source code to the console. Use `SPACE` or `n` to move to the next page of text, `ENTER` to scroll to the next line of text, `q` or `x` to quit.
+
+`-out|--output-source-code <DIRECTORY>`
+
+Outputs the source code to the specified directory.
+
+### Examples
+
+Search the index located in the `X:\test-index` directory interactively, showing 15 results per page in raw format:
+
+<code>dotnet lucene-cli.dll demo search-files X:\test-index -p 15 --raw</code>
+
+Run the query "foobar" against the "path" field in the index located in the `X:\test-index` directory:
+
+<code>dotnet lucene-cli.dll demo search-files X:\test-index --field path --query foobar</code>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/70f15595/src/tools/lucene-cli/docs/demo/simple-facets.md
----------------------------------------------------------------------
diff --git a/src/tools/lucene-cli/docs/demo/simple-facets.md b/src/tools/lucene-cli/docs/demo/simple-facets.md
new file mode 100644
index 0000000..cdb8f30
--- /dev/null
+++ b/src/tools/lucene-cli/docs/demo/simple-facets.md
@@ -0,0 +1,27 @@
+# simple-facets
+
+### Name
+
+`demo-simple-facets` - Shows simple usage of faceted indexing and searching.
+
+### Synopsis
+
+</code>dotnet lucene-cli.dll demo simple-facets [-src|--view-source-code] [-out|--output-source-code] [?|-h|--help]</code>
+
+### Options
+
+`?|-h|--help`
+
+Prints out a short help for the command.
+
+`-src|--view-source-code`
+
+Prints the source code to the console. Use `SPACE` or `n` to move to the next page of text, `ENTER` to scroll to the next line of text, `q` or `x` to quit.
+
+`-out|--output-source-code <DIRECTORY>`
+
+Outputs the source code to the specified directory.
+
+### Example
+
+<code>dotnet lucene-cli.dll demo simple-facets</code>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/70f15595/src/tools/lucene-cli/docs/demo/simple-sorted-set-facets.md
----------------------------------------------------------------------
diff --git a/src/tools/lucene-cli/docs/demo/simple-sorted-set-facets.md b/src/tools/lucene-cli/docs/demo/simple-sorted-set-facets.md
new file mode 100644
index 0000000..09052d9
--- /dev/null
+++ b/src/tools/lucene-cli/docs/demo/simple-sorted-set-facets.md
@@ -0,0 +1,29 @@
+# simple-sorted-set-facets
+
+### Name
+
+`demo-simple-sorted-set-facets` - Shows simple usage of faceted indexing and search using SortedSetDocValuesFacetField and SortedSetDocValuesFacetCounts.
+
+### Synopsis
+
+<code>dotnet lucene-cli.dll demo simple-sorted-set-facets [-src|--view-source-code] [-out|--output-source-code] [?|-h|--help]</code>
+
+### Options
+
+`?|-h|--help`
+
+Prints out a short help for the command.
+
+`-src|--view-source-code`
+
+Prints the source code to the console. Use `SPACE` or `n` to move to the next page of text, `ENTER` to scroll to the next line of text, `q` or `x` to quit.
+
+`-out|--output-source-code <DIRECTORY>`
+
+Outputs the source code to the specified directory.
+
+### Example
+
+<code>dotnet lucene-cli.dll demo simple-sorted-set-facets</code>
+
+

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/70f15595/src/tools/lucene-cli/docs/index.md
----------------------------------------------------------------------
diff --git a/src/tools/lucene-cli/docs/index.md b/src/tools/lucene-cli/docs/index.md
new file mode 100644
index 0000000..933336f
--- /dev/null
+++ b/src/tools/lucene-cli/docs/index.md
@@ -0,0 +1,25 @@
+# Lucene.Net command line interface (CLI) tools
+
+The Lucene.Net command line interface (CLI) is a new cross-platform toolchain with utilities for maintaining Lucene.Net and demos for learning basic Lucene.Net functionality.
+
+## Installation
+
+LUCENENET TODO
+
+## CLI Commands
+
+The following commands are installed:
+
+- [analysis](analysis/index.md)
+- [demo](demo/index.md)
+- [index](index/index.md)
+- [lock](lock/index.md)
+
+## Command structure
+
+CLI command structure consists of the driver ("dotnet lucene-cli.dll"), the command, and possibly command arguments and options. You see this pattern in most CLI operations, such as checking a Lucene.Net index for problematic segments and fixing (removing) them:
+
+```
+dotnet lucene-cli.dll index check C:\my-index --verbose
+dotnet lucene-cli.dll index fix C:\my-index
+```
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/70f15595/src/tools/lucene-cli/docs/index/check.md
----------------------------------------------------------------------
diff --git a/src/tools/lucene-cli/docs/index/check.md b/src/tools/lucene-cli/docs/index/check.md
new file mode 100644
index 0000000..caa18b2
--- /dev/null
+++ b/src/tools/lucene-cli/docs/index/check.md
@@ -0,0 +1,55 @@
+# check
+
+### Name
+
+`index-check` - Checks an index for problematic segments.
+
+### Synopsis
+
+<code>dotnet lucene-cli.dll index check [<INDEX_DIRECTORY>] [-v|--verbose] [-c|--cross-check-term-vectors] [-dir|--directory-type] [-s|--segment] [?|-h|--help]</code>
+
+### Description
+
+Basic tool to check the health of an index. 
+
+As this tool checks every byte in the index, on a large index it can take quite a long time to run.
+
+### Arguments
+
+`INDEX_DIRECTORY`
+
+The path to the directory of the index to check. If omitted, it defaults to the current working directory.
+
+### Options
+
+`?|-h|--help`
+
+Prints out a short help for the command.
+
+`-v|--verbose`
+
+Enable verbose output.
+
+`-c|--cross-check-term-vectors`
+
+Cross-check term vectors.
+
+`-dir|--directory-type <DIRECTORY_TYPE>`
+
+The FSDirectory implementation to use. If ommitted, it defaults to the optimal FSDirectory for your OS platform.
+
+`-s|--segment <SEGMENT>`
+
+Only check the specified segment(s). This can be specified multiple times, to check more than one segment, eg --segment _2 --segment _a.
+
+### Examples
+
+Check the index located at `X:\lucenenet-index\` verbosely, scanning only the segments named `_1j_Lucene41_0` and `_2u_Lucene41_0` for problems:
+
+<code>dotnet lucene-cli.dll index check X:\lucenenet-index -v -s _1j_Lucene41_0 -s _2u_Lucene41_0</code>
+
+
+Check the index located at `C:\taxonomy\` using the `MMapDirectory` memory-mapped directory implementation:
+
+<code>dotnet lucene-cli.dll index check C:\taxonomy --directory-type MMapDirectory</code>
+

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/70f15595/src/tools/lucene-cli/docs/index/copy-segments.md
----------------------------------------------------------------------
diff --git a/src/tools/lucene-cli/docs/index/copy-segments.md b/src/tools/lucene-cli/docs/index/copy-segments.md
new file mode 100644
index 0000000..c9868ef
--- /dev/null
+++ b/src/tools/lucene-cli/docs/index/copy-segments.md
@@ -0,0 +1,40 @@
+# copy-segments
+
+### Name
+
+`index-copy-segments` - Copies segments from one index to another index.
+
+### Synopsis
+
+<code>dotnet lucene-cli.dll index copy-segments <INPUT_DIRECTORY> <OUTPUT_DIRECTORY> <SEGMENT>[ <SEGMENT_2>...] [?|-h|--help]</code>
+
+### Description
+
+This tool does file-level copying of segments files. This means it's unable to split apart a single segment into multiple segments. For example if your index is a single segment, this tool won't help.  Also, it does basic file-level copying (using simple FileStream) so it will not work with non FSDirectory Directory implementations.
+
+### Arguments
+
+`INPUT_DIRECTORY`
+
+The directory of the index to copy.
+
+`OUTPUT_DIRECTORY`
+
+The directory of the destination index.
+
+`SEGMENT, SEGMENT_2`
+
+The segments to copy, separated by a space.
+
+### Options
+
+`?|-h|--help`
+
+Prints out a short help for the command.
+
+### Example
+
+Copy the `_71_Lucene41_0` segment from the index located at `X:\lucene-index` to the index located at `X:\output`:
+
+<code>dotnet lucene-cli.dll index copy-segments X:\lucene-index X:\output _71_Lucene41_0</code>
+

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/70f15595/src/tools/lucene-cli/docs/index/delete-segments.md
----------------------------------------------------------------------
diff --git a/src/tools/lucene-cli/docs/index/delete-segments.md b/src/tools/lucene-cli/docs/index/delete-segments.md
new file mode 100644
index 0000000..398d182
--- /dev/null
+++ b/src/tools/lucene-cli/docs/index/delete-segments.md
@@ -0,0 +1,35 @@
+# delete-segments
+
+### Name
+
+`index-delete-segments` - Deletes segments from an index.
+
+### Synopsis
+
+<code>dotnet lucene-cli.dll index delete-segments <INDEX_DIRECTORY> <SEGMENT>[ <SEGMENT_2>...] [?|-h|--help]</code>
+
+### Description
+
+You can easily accidentally remove segments from your index, so be careful! Always make a backup of your index first.
+
+### Arguments
+
+`INDEX_DIRECTORY`
+
+The directory of the index.
+
+`SEGMENT`
+
+The segments to delete, separated by a space.
+
+### Options
+
+`?|-h|--help`
+
+Prints out a short help for the command.
+
+### Example
+
+Delete the segments named `_8c` and `_83` from the index located at `X:\category-data\`:
+
+<code>dotnet lucene-cli.dll index delete-segments X:\category-data _8c _83</code>

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/70f15595/src/tools/lucene-cli/docs/index/extract-cfs.md
----------------------------------------------------------------------
diff --git a/src/tools/lucene-cli/docs/index/extract-cfs.md b/src/tools/lucene-cli/docs/index/extract-cfs.md
new file mode 100644
index 0000000..f6fc40e
--- /dev/null
+++ b/src/tools/lucene-cli/docs/index/extract-cfs.md
@@ -0,0 +1,42 @@
+# extract-cfs
+
+### Name
+
+`index-extract-cfs` - Extracts sub-files from a `.cfs` compound file.
+
+### Synopsis
+
+<code>dotnet lucene-cli.dll index extract-cfs <CFS_FILE_NAME> [-dir|--directory-type] [?|-h|--help]</code>
+
+### Description
+
+Extracts `.cfs` compound files (that were created using the `CompoundFileDirectory` from Lucene.Net.Misc) to the current working directory.
+
+In order to make the extracted version of the index work, you have to copy the segments file from the compound index into the directory where the extracted files are stored.
+
+### Arguments
+
+`CFS_FILE_NAME`
+
+The path to a `.cfs` compound file containing words to parse.
+
+### Options
+
+`?|-h|--help`
+
+Prints out a short help for the command.
+
+`-dir|--directory-type <DIRECTORY_TYPE>`
+
+The FSDirectory implementation to use. If ommitted, it defaults to the optimal FSDirectory for your OS platform.
+
+### Examples
+
+Extract the files from the compound file at `X:\lucene-index\_81.cfs` to the current working directory:
+
+<code>dotnet lucene-cli.dll index extract-cfs X:\lucene-index\_81.cfs</code>
+
+
+Extract the files from the compound file at `X:\lucene-index\_64.cfs` to the current working directory using the `SimpleFSDirectory` implementation:
+
+<code>dotnet lucene-cli.dll index extract-cfs X:\lucene-index\_64.cfs --directory-type SimpleFSDirectory</code>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/70f15595/src/tools/lucene-cli/docs/index/fix.md
----------------------------------------------------------------------
diff --git a/src/tools/lucene-cli/docs/index/fix.md b/src/tools/lucene-cli/docs/index/fix.md
new file mode 100644
index 0000000..3158aab
--- /dev/null
+++ b/src/tools/lucene-cli/docs/index/fix.md
@@ -0,0 +1,54 @@
+# fix
+
+### Name
+
+`index-fix` - Fixes an index by removing problematic segments.
+
+### Synopsis
+
+<code>dotnet lucene-cli.dll index fix [<INDEX_DIRECTORY>] [-v|--verbose] [-c|--cross-check-term-vectors] [-dir|--directory-type] [--dry-run] [?|-h|--help]</code>
+
+### Description
+
+Basic tool to write a new segments file that removes reference to problematic segments. As this tool checks every byte in the index, on a large index it can take quite a long time to run.
+
+> **WARNING:** This command should only be used on an emergency basis as it will cause documents (perhaps many) to be permanently removed from the index. Always make a backup copy of your index before running this! Do not run this tool on an index that is actively being written to. You have been warned!
+
+### Arguments
+
+`INDEX_DIRECTORY`
+
+The directory of the index. If omitted, it defaults to the current working directory.
+
+### Options
+
+`?|-h|--help`
+
+Prints out a short help for the command.
+
+`-v|--verbose`
+
+Enables verbose output.
+
+`-c|--cross-check-term-vectors`
+
+Cross check term vectors.
+
+`-dir|--directory-type <DIRECTORY_TYPE>`
+
+The `FSDirectory` implementation to use. If omitted, it defaults to the optimal `FSDirectory` for your OS platform.
+
+`--dry-run`
+
+Doesn't change the index, but reports any actions that would be taken if this option were not supplied.
+
+### Examples
+
+Check what a fix operation would do if run on the index located at `X:\product-index\`, using verbose output:
+
+<code>dotnet lucene-cli.dll index fix X:\product-index --verbose --dry-run</code>
+
+
+Fix the index located at `X:\product-index` and cross check term vectors:
+
+<code>dotnet lucene-cli.dll index fix X:\product-index -c</code>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/70f15595/src/tools/lucene-cli/docs/index/index.md
----------------------------------------------------------------------
diff --git a/src/tools/lucene-cli/docs/index/index.md b/src/tools/lucene-cli/docs/index/index.md
new file mode 100644
index 0000000..43f323e
--- /dev/null
+++ b/src/tools/lucene-cli/docs/index/index.md
@@ -0,0 +1,23 @@
+# index
+
+## Description
+
+Utilities to manage specialized analyzers.
+
+> **WARNING:** Many of these operations change an index in ways that cannot be reversed. Always make a backup of your index before running these commands. 
+
+## Commands
+
+- [check](check.md)
+- [copy-segments](copy-segments.md)
+- [delete-segments](delete-segments.md)
+- [extract-cfs](extract-cfs.md)
+- [fix](fix.md)
+- [list-cfs](list-cfs.md)
+- [list-high-freq-terms](list-high-freq-terms.md)
+- [list-segments](list-segments.md)
+- [list-taxonomy-stats](list-taxonomy-stats.md)
+- [list-term-info](list-term-info.md)
+- [merge](merge.md)
+- [split](split.md)
+- [upgrade](upgrade.md)
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/70f15595/src/tools/lucene-cli/docs/index/list-cfs.md
----------------------------------------------------------------------
diff --git a/src/tools/lucene-cli/docs/index/list-cfs.md b/src/tools/lucene-cli/docs/index/list-cfs.md
new file mode 100644
index 0000000..6629dfa
--- /dev/null
+++ b/src/tools/lucene-cli/docs/index/list-cfs.md
@@ -0,0 +1,36 @@
+# list-cfs
+
+### Name
+
+`index-list-cfs` - Lists sub-files from a `.cfs` compound file.
+
+### Synopsis
+
+<code>dotnet lucene-cli.dll index list-cfs <CFS_FILE_NAME> [-dir|--directory-type] [?|-h|--help]</code>
+
+### Description
+
+Prints the filename and size of each file within a given `.cfs` compound file. The .cfs compound file format is created using the CompoundFileDirectory from Lucene.Net.Misc.
+
+### Arguments
+
+`CFS_FILE_NAME`
+
+The `.cfs` compound file containing words to parse.
+
+### Options
+
+`?|-h|--help`
+
+Prints out a short help for the command.
+
+`-dir|--directory-type <DIRECTORY_TYPE>`
+
+The `FSDirectory` implementation to use. If omitted, defaults to the optimal `FSDirectory` for your OS platform.
+
+### Example
+
+Lists the files within the `X:\categories\_53.cfs` compound file using the `NIOFSDirectory` directory implementation:
+
+<code>dotnet lucene-cli.dll index list-cfs X:\categories\_53.cfs -dir NIOFSDirectory</code>
+

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/70f15595/src/tools/lucene-cli/docs/index/list-high-freq-terms.md
----------------------------------------------------------------------
diff --git a/src/tools/lucene-cli/docs/index/list-high-freq-terms.md b/src/tools/lucene-cli/docs/index/list-high-freq-terms.md
new file mode 100644
index 0000000..bbeb364
--- /dev/null
+++ b/src/tools/lucene-cli/docs/index/list-high-freq-terms.md
@@ -0,0 +1,49 @@
+# list-high-freq-terms
+
+### Name
+
+`index-list-high-freq-terms` - Lists the top *N* most frequent terms by document frequency.
+
+### Synopsis
+
+<code>dotnet lucene-cli.dll index list-high-freq-terms [<INDEX_DIRECTORY>] [-t|--total-term-frequency] [-n|--number-of-terms] [-f|--field] [?|-h|--help]</code>
+
+### Description
+
+Extracts the top *N* most frequent terms (by document frequency) from an existing Lucene index and reports their
+document frequency.
+
+### Arguments
+
+`INDEX_DIRECTORY`
+
+The directory of the index. If omitted, it defaults to the current working directory.
+
+### Options
+
+`?|-h|--help`
+
+Prints out a short help for the command.
+
+`-t|--total-term-frequency`
+
+Specifies that both the document frequency and term frequency are reported, ordered by descending total term frequency.
+
+`-n|--number-of-terms <NUMBER>`
+
+The number of terms to consider. If omitted, defaults to 100.
+
+`-f|--field <FIELD>`
+
+The field to consider. If omitted, considers all fields.
+
+### Examples
+
+List the high frequency terms in the index located at `F:\product-index\` on the `description` field, reporting both document frequency and term frequency:
+
+<code>dotnet lucene-cli.dll index list-high-freq-terms F:\product-index --total-term-frequency --field description</code>
+
+
+List the high frequency terms in the index located at `C:\lucene-index\` on the `name` field, tracking 30 terms:
+
+<code>dotnet lucene-cli.dll index list-high-freq-terms C:\lucene-index --f name -n 30</code>

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/70f15595/src/tools/lucene-cli/docs/index/list-segments.md
----------------------------------------------------------------------
diff --git a/src/tools/lucene-cli/docs/index/list-segments.md b/src/tools/lucene-cli/docs/index/list-segments.md
new file mode 100644
index 0000000..25f07b9
--- /dev/null
+++ b/src/tools/lucene-cli/docs/index/list-segments.md
@@ -0,0 +1,32 @@
+# list-segments
+
+### Name
+
+`index-list-segments` - Lists segments in an index.
+
+### Synopsis
+
+<code>dotnet lucene-cli.dll index list-segments [<INDEX_DIRECTORY>] [?|-h|--help]</code>
+
+### Description
+
+After running this command to view segments, use [copy-segments](copy-segments.md) to copy segments from one index directory to another or [delete-segments](delete-segments.md) to remove segments from an index.
+
+### Arguments
+
+`INDEX_DIRECTORY`
+
+The directory of the index. If omitted, it defaults to the current working directory.
+
+### Options
+
+`?|-h|--help`
+
+Prints out a short help for the command.
+
+### Example
+
+List the segments in the index located at `X:\lucene-index\`:
+
+<code>dotnet lucene-cli.dll index list-segments X:\lucene-index</code>
+

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/70f15595/src/tools/lucene-cli/docs/index/list-taxonomy-stats.md
----------------------------------------------------------------------
diff --git a/src/tools/lucene-cli/docs/index/list-taxonomy-stats.md b/src/tools/lucene-cli/docs/index/list-taxonomy-stats.md
new file mode 100644
index 0000000..7c43343
--- /dev/null
+++ b/src/tools/lucene-cli/docs/index/list-taxonomy-stats.md
@@ -0,0 +1,38 @@
+# list-taxonomy-stats
+
+### Name
+
+`index-list-taxonomy-stats` - Displays the taxonomy statistical information for a taxonomy index.
+
+### Synopsis
+
+<code>dotnet lucene-cli.dll index list-taxonomy-stats [<INDEX_DIRECTORY>] [-tree|--show-tree] [?|-h|--help]</code>
+
+### Description
+
+Prints how many ords are under each dimension.
+
+### Arguments
+
+`INDEX_DIRECTORY`
+
+The directory of the index. If omitted, it defaults to the current working directory.
+
+> **NOTE:** This directory must be a facet taxonomy directory for the command to succeed.
+
+### Options
+
+`?|-h|--help`
+
+Prints out a short help for the command.
+
+`-tree|--show-tree`
+
+Recursively lists all descendant nodes.
+
+### Example
+
+List the taxonomy statistics from the index located at `X:\category-taxonomy-index\`, viewing all descendant nodes:
+
+<code>dotnet lucene-cli.dll index list-taxonomy-stats X:\category-taxonomy-index -tree</code>
+


[15/22] lucenenet git commit: Lucene.Net.Tests.Cli: Added LuceneNetSpecific attribute to all tests

Posted by ni...@apache.org.
Lucene.Net.Tests.Cli: Added LuceneNetSpecific attribute to all tests


Project: http://git-wip-us.apache.org/repos/asf/lucenenet/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucenenet/commit/f17e8b7a
Tree: http://git-wip-us.apache.org/repos/asf/lucenenet/tree/f17e8b7a
Diff: http://git-wip-us.apache.org/repos/asf/lucenenet/diff/f17e8b7a

Branch: refs/heads/master
Commit: f17e8b7ae2804e99bc4ca2f3cb71cafea9284e40
Parents: 71d82b6
Author: Shad Storhaug <sh...@shadstorhaug.com>
Authored: Tue Jul 11 11:25:33 2017 +0700
Committer: Shad Storhaug <sh...@shadstorhaug.com>
Committed: Tue Jul 11 11:25:33 2017 +0700

----------------------------------------------------------------------
 .../Commands/Analysis/AnalysisCommandTest.cs                 | 4 +++-
 .../Analysis/AnalysisStempelCompileStemsCommandTest.cs       | 4 +++-
 .../Analysis/AnalysisStempelPatchStemsCommandTest.cs         | 4 +++-
 src/tools/Lucene.Net.Tests.Cli/Commands/CommandTestCase.cs   | 8 +++++++-
 .../Lucene.Net.Tests.Cli/Commands/Demo/DemoCommandTest.cs    | 4 +++-
 .../Commands/Demo/DemoIndexFilesCommandTest.cs               | 5 ++++-
 .../Commands/Demo/DemoSearchFilesCommandTest.cs              | 5 ++++-
 .../Commands/Index/IndexCheckCommandTest.cs                  | 4 +++-
 .../Lucene.Net.Tests.Cli/Commands/Index/IndexCommandTest.cs  | 5 ++++-
 .../Commands/Index/IndexCopySegmentsTest.cs                  | 4 +++-
 .../Commands/Index/IndexDeleteSegmentsCommandTest.cs         | 4 +++-
 .../Commands/Index/IndexExtractCfsCommandTest.cs             | 4 +++-
 .../Commands/Index/IndexFixCommandTest.cs                    | 6 +++++-
 .../Commands/Index/IndexListCfsCommandTest.cs                | 5 ++++-
 .../Commands/Index/IndexListHighFreqTermsCommandTest.cs      | 5 ++++-
 .../Commands/Index/IndexListSegmentsCommandTest.cs           | 5 ++++-
 .../Commands/Index/IndexListTaxonomyStatsCommandTest.cs      | 5 ++++-
 .../Commands/Index/IndexListTermInfoCommandTest.cs           | 5 ++++-
 .../Commands/Index/IndexMergeCommandTest.cs                  | 4 +++-
 .../Commands/Index/IndexSplitCommandTest.cs                  | 5 ++++-
 .../Commands/Index/IndexUpgradeCommandTest.cs                | 8 +++++++-
 .../Lucene.Net.Tests.Cli/Commands/Lock/LockCommandTest.cs    | 5 ++++-
 .../Commands/Lock/LockStressTestCommandTest.cs               | 5 ++++-
 .../Commands/Lock/LockVerifyServerCommandTest.cs             | 5 ++++-
 src/tools/Lucene.Net.Tests.Cli/Commands/RootCommandTest.cs   | 5 ++++-
 src/tools/Lucene.Net.Tests.Cli/EnvironmentTest.cs            | 5 ++++-
 .../Lucene.Net.Tests.Cli/SourceCode/SourceCodeParserTest.cs  | 4 +++-
 27 files changed, 105 insertions(+), 27 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucenenet/blob/f17e8b7a/src/tools/Lucene.Net.Tests.Cli/Commands/Analysis/AnalysisCommandTest.cs
----------------------------------------------------------------------
diff --git a/src/tools/Lucene.Net.Tests.Cli/Commands/Analysis/AnalysisCommandTest.cs b/src/tools/Lucene.Net.Tests.Cli/Commands/Analysis/AnalysisCommandTest.cs
index b0082e5..43375f2 100644
--- a/src/tools/Lucene.Net.Tests.Cli/Commands/Analysis/AnalysisCommandTest.cs
+++ b/src/tools/Lucene.Net.Tests.Cli/Commands/Analysis/AnalysisCommandTest.cs
@@ -1,4 +1,5 @@
-using Lucene.Net.Cli.CommandLine;
+using Lucene.Net.Attributes;
+using Lucene.Net.Cli.CommandLine;
 using NUnit.Framework;
 using System.Collections.Generic;
 
@@ -40,6 +41,7 @@ namespace Lucene.Net.Cli.Commands
         }
 
         [Test]
+        [LuceneNetSpecific]
         public virtual void TestTooManyArguments()
         {
             Assert.Throws<CommandParsingException>(() => AssertConsoleOutput("one", ""));

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/f17e8b7a/src/tools/Lucene.Net.Tests.Cli/Commands/Analysis/AnalysisStempelCompileStemsCommandTest.cs
----------------------------------------------------------------------
diff --git a/src/tools/Lucene.Net.Tests.Cli/Commands/Analysis/AnalysisStempelCompileStemsCommandTest.cs b/src/tools/Lucene.Net.Tests.Cli/Commands/Analysis/AnalysisStempelCompileStemsCommandTest.cs
index fdcae26..2ff1367 100644
--- a/src/tools/Lucene.Net.Tests.Cli/Commands/Analysis/AnalysisStempelCompileStemsCommandTest.cs
+++ b/src/tools/Lucene.Net.Tests.Cli/Commands/Analysis/AnalysisStempelCompileStemsCommandTest.cs
@@ -1,4 +1,5 @@
-using NUnit.Framework;
+using Lucene.Net.Attributes;
+using NUnit.Framework;
 using System.Collections.Generic;
 
 namespace Lucene.Net.Cli.Commands
@@ -49,6 +50,7 @@ namespace Lucene.Net.Cli.Commands
         }
 
         [Test]
+        [LuceneNetSpecific]
         public virtual void TestNotEnoughArguments()
         {
             AssertConsoleOutput("one", FromResource("NotEnoughArguments", 2));

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/f17e8b7a/src/tools/Lucene.Net.Tests.Cli/Commands/Analysis/AnalysisStempelPatchStemsCommandTest.cs
----------------------------------------------------------------------
diff --git a/src/tools/Lucene.Net.Tests.Cli/Commands/Analysis/AnalysisStempelPatchStemsCommandTest.cs b/src/tools/Lucene.Net.Tests.Cli/Commands/Analysis/AnalysisStempelPatchStemsCommandTest.cs
index 41d6637..05ac238 100644
--- a/src/tools/Lucene.Net.Tests.Cli/Commands/Analysis/AnalysisStempelPatchStemsCommandTest.cs
+++ b/src/tools/Lucene.Net.Tests.Cli/Commands/Analysis/AnalysisStempelPatchStemsCommandTest.cs
@@ -1,4 +1,5 @@
-using NUnit.Framework;
+using Lucene.Net.Attributes;
+using NUnit.Framework;
 using System.Collections.Generic;
 
 namespace Lucene.Net.Cli.Commands.Analysis
@@ -48,6 +49,7 @@ namespace Lucene.Net.Cli.Commands.Analysis
         }
 
         [Test]
+        [LuceneNetSpecific]
         public virtual void TestNotEnoughArguments()
         {
             AssertConsoleOutput("", FromResource("NotEnoughArguments", 1));

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/f17e8b7a/src/tools/Lucene.Net.Tests.Cli/Commands/CommandTestCase.cs
----------------------------------------------------------------------
diff --git a/src/tools/Lucene.Net.Tests.Cli/Commands/CommandTestCase.cs b/src/tools/Lucene.Net.Tests.Cli/Commands/CommandTestCase.cs
index 9174667..35485bf 100644
--- a/src/tools/Lucene.Net.Tests.Cli/Commands/CommandTestCase.cs
+++ b/src/tools/Lucene.Net.Tests.Cli/Commands/CommandTestCase.cs
@@ -1,4 +1,5 @@
-using Lucene.Net.Util;
+using Lucene.Net.Attributes;
+using Lucene.Net.Util;
 using NUnit.Framework;
 using System.Collections.Generic;
 using System.IO;
@@ -71,6 +72,7 @@ namespace Lucene.Net.Cli.Commands
         }
 
         [Test]
+        [LuceneNetSpecific]
         public virtual void TestAllValidCombinations()
         {
             var requiredArgs = GetRequiredArgs().ExpandArgs().RequiredParameters();
@@ -95,12 +97,14 @@ namespace Lucene.Net.Cli.Commands
         }
 
         [Test]
+        [LuceneNetSpecific]
         public virtual void TestHelp()
         {
             AssertConsoleOutput("?", "Version");
         }
 
         [Test]
+        [LuceneNetSpecific]
         public virtual void TestCommandHasDescription()
         {
             var output = new MockConsoleApp();
@@ -110,6 +114,7 @@ namespace Lucene.Net.Cli.Commands
         }
 
         [Test]
+        [LuceneNetSpecific]
         public virtual void TestAllArgumentsHaveDescription()
         {
             var output = new MockConsoleApp();
@@ -122,6 +127,7 @@ namespace Lucene.Net.Cli.Commands
         }
 
         [Test]
+        [LuceneNetSpecific]
         public virtual void TestAllOptionsHaveDescription()
         {
             var output = new MockConsoleApp();

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/f17e8b7a/src/tools/Lucene.Net.Tests.Cli/Commands/Demo/DemoCommandTest.cs
----------------------------------------------------------------------
diff --git a/src/tools/Lucene.Net.Tests.Cli/Commands/Demo/DemoCommandTest.cs b/src/tools/Lucene.Net.Tests.Cli/Commands/Demo/DemoCommandTest.cs
index 3f448fa..1de67f3 100644
--- a/src/tools/Lucene.Net.Tests.Cli/Commands/Demo/DemoCommandTest.cs
+++ b/src/tools/Lucene.Net.Tests.Cli/Commands/Demo/DemoCommandTest.cs
@@ -1,4 +1,5 @@
-using Lucene.Net.Cli.CommandLine;
+using Lucene.Net.Attributes;
+using Lucene.Net.Cli.CommandLine;
 using NUnit.Framework;
 using System.Collections.Generic;
 
@@ -40,6 +41,7 @@ namespace Lucene.Net.Cli.Commands
         }
 
         [Test]
+        [LuceneNetSpecific]
         public virtual void TestTooManyArguments()
         {
             Assert.Throws<CommandParsingException>(() => AssertConsoleOutput("one", ""));

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/f17e8b7a/src/tools/Lucene.Net.Tests.Cli/Commands/Demo/DemoIndexFilesCommandTest.cs
----------------------------------------------------------------------
diff --git a/src/tools/Lucene.Net.Tests.Cli/Commands/Demo/DemoIndexFilesCommandTest.cs b/src/tools/Lucene.Net.Tests.Cli/Commands/Demo/DemoIndexFilesCommandTest.cs
index e892eb1..da756af 100644
--- a/src/tools/Lucene.Net.Tests.Cli/Commands/Demo/DemoIndexFilesCommandTest.cs
+++ b/src/tools/Lucene.Net.Tests.Cli/Commands/Demo/DemoIndexFilesCommandTest.cs
@@ -1,4 +1,5 @@
-using Lucene.Net.Cli.CommandLine;
+using Lucene.Net.Attributes;
+using Lucene.Net.Cli.CommandLine;
 using NUnit.Framework;
 using System.Collections.Generic;
 
@@ -47,12 +48,14 @@ namespace Lucene.Net.Cli.Commands.Demo
         }
 
         [Test]
+        [LuceneNetSpecific]
         public virtual void TestNotEnoughArguments()
         {
             AssertConsoleOutput("one", FromResource("NotEnoughArguments", 2));
         }
 
         [Test]
+        [LuceneNetSpecific]
         public virtual void TestTooManyArguments()
         {
             Assert.Throws<CommandParsingException>(() => AssertConsoleOutput("one two three", ""));

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/f17e8b7a/src/tools/Lucene.Net.Tests.Cli/Commands/Demo/DemoSearchFilesCommandTest.cs
----------------------------------------------------------------------
diff --git a/src/tools/Lucene.Net.Tests.Cli/Commands/Demo/DemoSearchFilesCommandTest.cs b/src/tools/Lucene.Net.Tests.Cli/Commands/Demo/DemoSearchFilesCommandTest.cs
index 3ae64be..84231c1 100644
--- a/src/tools/Lucene.Net.Tests.Cli/Commands/Demo/DemoSearchFilesCommandTest.cs
+++ b/src/tools/Lucene.Net.Tests.Cli/Commands/Demo/DemoSearchFilesCommandTest.cs
@@ -1,4 +1,5 @@
-using Lucene.Net.Cli.CommandLine;
+using Lucene.Net.Attributes;
+using Lucene.Net.Cli.CommandLine;
 using NUnit.Framework;
 using System.Collections.Generic;
 
@@ -50,12 +51,14 @@ namespace Lucene.Net.Cli.Commands.Demo
         }
 
         [Test]
+        [LuceneNetSpecific]
         public virtual void TestNotEnoughArguments()
         {
             AssertConsoleOutput("", FromResource("NotEnoughArguments", 1));
         }
 
         [Test]
+        [LuceneNetSpecific]
         public virtual void TestTooManyArguments()
         {
             Assert.Throws<CommandParsingException>(() => AssertConsoleOutput("one two", ""));

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/f17e8b7a/src/tools/Lucene.Net.Tests.Cli/Commands/Index/IndexCheckCommandTest.cs
----------------------------------------------------------------------
diff --git a/src/tools/Lucene.Net.Tests.Cli/Commands/Index/IndexCheckCommandTest.cs b/src/tools/Lucene.Net.Tests.Cli/Commands/Index/IndexCheckCommandTest.cs
index 5521124..8193ca5 100644
--- a/src/tools/Lucene.Net.Tests.Cli/Commands/Index/IndexCheckCommandTest.cs
+++ b/src/tools/Lucene.Net.Tests.Cli/Commands/Index/IndexCheckCommandTest.cs
@@ -1,4 +1,5 @@
-using NUnit.Framework;
+using Lucene.Net.Attributes;
+using NUnit.Framework;
 using System.Collections.Generic;
 
 namespace Lucene.Net.Cli.Commands
@@ -57,6 +58,7 @@ namespace Lucene.Net.Cli.Commands
         /// Ensures the current working directory is used when index directory is not supplied. 
         /// </summary>
         [Test]
+        [LuceneNetSpecific]
         public virtual void TestNoArguments()
         {
             System.IO.Directory.SetCurrentDirectory(@"C:\");

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/f17e8b7a/src/tools/Lucene.Net.Tests.Cli/Commands/Index/IndexCommandTest.cs
----------------------------------------------------------------------
diff --git a/src/tools/Lucene.Net.Tests.Cli/Commands/Index/IndexCommandTest.cs b/src/tools/Lucene.Net.Tests.Cli/Commands/Index/IndexCommandTest.cs
index 5ec554b..7deb6b1 100644
--- a/src/tools/Lucene.Net.Tests.Cli/Commands/Index/IndexCommandTest.cs
+++ b/src/tools/Lucene.Net.Tests.Cli/Commands/Index/IndexCommandTest.cs
@@ -1,4 +1,5 @@
-using Lucene.Net.Cli.CommandLine;
+using Lucene.Net.Attributes;
+using Lucene.Net.Cli.CommandLine;
 using NUnit.Framework;
 using System.Collections.Generic;
 
@@ -42,12 +43,14 @@ namespace Lucene.Net.Cli.Commands
         /// Ensures the current working directory is used when index directory is not supplied. 
         /// </summary>
         [Test]
+        [LuceneNetSpecific]
         public virtual void TestNoArguments()
         {
             AssertConsoleOutput("", "Lucene.Net Command Line Utility, Version");
         }
 
         [Test]
+        [LuceneNetSpecific]
         public virtual void TestTooManyArguments()
         {
             Assert.Throws<CommandParsingException>(() => AssertConsoleOutput("one", ""));

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/f17e8b7a/src/tools/Lucene.Net.Tests.Cli/Commands/Index/IndexCopySegmentsTest.cs
----------------------------------------------------------------------
diff --git a/src/tools/Lucene.Net.Tests.Cli/Commands/Index/IndexCopySegmentsTest.cs b/src/tools/Lucene.Net.Tests.Cli/Commands/Index/IndexCopySegmentsTest.cs
index 3c14af5..d04e630 100644
--- a/src/tools/Lucene.Net.Tests.Cli/Commands/Index/IndexCopySegmentsTest.cs
+++ b/src/tools/Lucene.Net.Tests.Cli/Commands/Index/IndexCopySegmentsTest.cs
@@ -1,4 +1,5 @@
-using NUnit.Framework;
+using Lucene.Net.Attributes;
+using NUnit.Framework;
 using System.Collections.Generic;
 
 namespace Lucene.Net.Cli.Commands
@@ -49,6 +50,7 @@ namespace Lucene.Net.Cli.Commands
         }
 
         [Test]
+        [LuceneNetSpecific]
         public virtual void TestNotEnoughArguments()
         {
             AssertConsoleOutput("one two", FromResource("NotEnoughArguments", 3));

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/f17e8b7a/src/tools/Lucene.Net.Tests.Cli/Commands/Index/IndexDeleteSegmentsCommandTest.cs
----------------------------------------------------------------------
diff --git a/src/tools/Lucene.Net.Tests.Cli/Commands/Index/IndexDeleteSegmentsCommandTest.cs b/src/tools/Lucene.Net.Tests.Cli/Commands/Index/IndexDeleteSegmentsCommandTest.cs
index bc72375..3c2d848 100644
--- a/src/tools/Lucene.Net.Tests.Cli/Commands/Index/IndexDeleteSegmentsCommandTest.cs
+++ b/src/tools/Lucene.Net.Tests.Cli/Commands/Index/IndexDeleteSegmentsCommandTest.cs
@@ -1,4 +1,5 @@
-using NUnit.Framework;
+using Lucene.Net.Attributes;
+using NUnit.Framework;
 using System.Collections.Generic;
 
 namespace Lucene.Net.Cli.Commands
@@ -49,6 +50,7 @@ namespace Lucene.Net.Cli.Commands
         }
 
         [Test]
+        [LuceneNetSpecific]
         public virtual void TestNotEnoughArguments()
         {
             AssertConsoleOutput("one", FromResource("NotEnoughArguments", 2));

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/f17e8b7a/src/tools/Lucene.Net.Tests.Cli/Commands/Index/IndexExtractCfsCommandTest.cs
----------------------------------------------------------------------
diff --git a/src/tools/Lucene.Net.Tests.Cli/Commands/Index/IndexExtractCfsCommandTest.cs b/src/tools/Lucene.Net.Tests.Cli/Commands/Index/IndexExtractCfsCommandTest.cs
index 2325d0d..c418acc 100644
--- a/src/tools/Lucene.Net.Tests.Cli/Commands/Index/IndexExtractCfsCommandTest.cs
+++ b/src/tools/Lucene.Net.Tests.Cli/Commands/Index/IndexExtractCfsCommandTest.cs
@@ -1,4 +1,5 @@
-using NUnit.Framework;
+using Lucene.Net.Attributes;
+using NUnit.Framework;
 using System.Collections.Generic;
 
 namespace Lucene.Net.Cli.Commands
@@ -47,6 +48,7 @@ namespace Lucene.Net.Cli.Commands
         }
 
         [Test]
+        [LuceneNetSpecific]
         public virtual void TestNotEnoughArguments()
         {
             AssertConsoleOutput("", FromResource("NotEnoughArguments", 1));

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/f17e8b7a/src/tools/Lucene.Net.Tests.Cli/Commands/Index/IndexFixCommandTest.cs
----------------------------------------------------------------------
diff --git a/src/tools/Lucene.Net.Tests.Cli/Commands/Index/IndexFixCommandTest.cs b/src/tools/Lucene.Net.Tests.Cli/Commands/Index/IndexFixCommandTest.cs
index d153f2d..6406137 100644
--- a/src/tools/Lucene.Net.Tests.Cli/Commands/Index/IndexFixCommandTest.cs
+++ b/src/tools/Lucene.Net.Tests.Cli/Commands/Index/IndexFixCommandTest.cs
@@ -1,4 +1,5 @@
-using Lucene.Net.Cli.CommandLine;
+using Lucene.Net.Attributes;
+using Lucene.Net.Cli.CommandLine;
 using NUnit.Framework;
 using System.Collections.Generic;
 using System.Linq;
@@ -54,6 +55,7 @@ namespace Lucene.Net.Cli.Commands
         }
 
         [Test]
+        [LuceneNetSpecific]
         public override void TestAllValidCombinations()
         {
             var requiredArgs = GetRequiredArgs().ExpandArgs().RequiredParameters();
@@ -83,6 +85,7 @@ namespace Lucene.Net.Cli.Commands
         }
 
         [Test]
+        [LuceneNetSpecific]
         public virtual void TestNoArguments()
         {
             System.IO.Directory.SetCurrentDirectory(@"C:\");
@@ -90,6 +93,7 @@ namespace Lucene.Net.Cli.Commands
         }
 
         [Test]
+        [LuceneNetSpecific]
         public virtual void TestTooManyArguments()
         {
             Assert.Throws<CommandParsingException>(() => AssertConsoleOutput("one two", ""));

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/f17e8b7a/src/tools/Lucene.Net.Tests.Cli/Commands/Index/IndexListCfsCommandTest.cs
----------------------------------------------------------------------
diff --git a/src/tools/Lucene.Net.Tests.Cli/Commands/Index/IndexListCfsCommandTest.cs b/src/tools/Lucene.Net.Tests.Cli/Commands/Index/IndexListCfsCommandTest.cs
index 244e2fc..c1cac24 100644
--- a/src/tools/Lucene.Net.Tests.Cli/Commands/Index/IndexListCfsCommandTest.cs
+++ b/src/tools/Lucene.Net.Tests.Cli/Commands/Index/IndexListCfsCommandTest.cs
@@ -1,4 +1,5 @@
-using Lucene.Net.Cli.CommandLine;
+using Lucene.Net.Attributes;
+using Lucene.Net.Cli.CommandLine;
 using NUnit.Framework;
 using System.Collections.Generic;
 
@@ -48,12 +49,14 @@ namespace Lucene.Net.Cli.Commands
         }
 
         [Test]
+        [LuceneNetSpecific]
         public virtual void TestNotEnoughArguments()
         {
             AssertConsoleOutput("", FromResource("NotEnoughArguments", 1));
         }
 
         [Test]
+        [LuceneNetSpecific]
         public virtual void TestTooManyArguments()
         {
             Assert.Throws<CommandParsingException>(() => AssertConsoleOutput("one two", ""));

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/f17e8b7a/src/tools/Lucene.Net.Tests.Cli/Commands/Index/IndexListHighFreqTermsCommandTest.cs
----------------------------------------------------------------------
diff --git a/src/tools/Lucene.Net.Tests.Cli/Commands/Index/IndexListHighFreqTermsCommandTest.cs b/src/tools/Lucene.Net.Tests.Cli/Commands/Index/IndexListHighFreqTermsCommandTest.cs
index e12aeea..42ab9c6 100644
--- a/src/tools/Lucene.Net.Tests.Cli/Commands/Index/IndexListHighFreqTermsCommandTest.cs
+++ b/src/tools/Lucene.Net.Tests.Cli/Commands/Index/IndexListHighFreqTermsCommandTest.cs
@@ -1,4 +1,5 @@
-using Lucene.Net.Cli.CommandLine;
+using Lucene.Net.Attributes;
+using Lucene.Net.Cli.CommandLine;
 using NUnit.Framework;
 using System.Collections.Generic;
 
@@ -52,6 +53,7 @@ namespace Lucene.Net.Cli.Commands
         /// Ensures the current working directory is used when index directory is not supplied. 
         /// </summary>
         [Test]
+        [LuceneNetSpecific]
         public virtual void TestNoArguments()
         {
             System.IO.Directory.SetCurrentDirectory(@"C:\");
@@ -59,6 +61,7 @@ namespace Lucene.Net.Cli.Commands
         }
 
         [Test]
+        [LuceneNetSpecific]
         public virtual void TestTooManyArguments()
         {
             Assert.Throws<CommandParsingException>(() => AssertConsoleOutput("one two", ""));

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/f17e8b7a/src/tools/Lucene.Net.Tests.Cli/Commands/Index/IndexListSegmentsCommandTest.cs
----------------------------------------------------------------------
diff --git a/src/tools/Lucene.Net.Tests.Cli/Commands/Index/IndexListSegmentsCommandTest.cs b/src/tools/Lucene.Net.Tests.Cli/Commands/Index/IndexListSegmentsCommandTest.cs
index a8e4837..341df92 100644
--- a/src/tools/Lucene.Net.Tests.Cli/Commands/Index/IndexListSegmentsCommandTest.cs
+++ b/src/tools/Lucene.Net.Tests.Cli/Commands/Index/IndexListSegmentsCommandTest.cs
@@ -1,4 +1,5 @@
-using Lucene.Net.Cli.CommandLine;
+using Lucene.Net.Attributes;
+using Lucene.Net.Cli.CommandLine;
 using NUnit.Framework;
 using System.Collections.Generic;
 
@@ -48,6 +49,7 @@ namespace Lucene.Net.Cli.Commands
         /// Ensures the current working directory is used when index directory is not supplied. 
         /// </summary>
         [Test]
+        [LuceneNetSpecific]
         public virtual void TestNoArguments()
         {
             System.IO.Directory.SetCurrentDirectory(@"C:\");
@@ -55,6 +57,7 @@ namespace Lucene.Net.Cli.Commands
         }
 
         [Test]
+        [LuceneNetSpecific]
         public virtual void TestTooManyArguments()
         {
             Assert.Throws<CommandParsingException>(() => AssertConsoleOutput("one two", ""));

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/f17e8b7a/src/tools/Lucene.Net.Tests.Cli/Commands/Index/IndexListTaxonomyStatsCommandTest.cs
----------------------------------------------------------------------
diff --git a/src/tools/Lucene.Net.Tests.Cli/Commands/Index/IndexListTaxonomyStatsCommandTest.cs b/src/tools/Lucene.Net.Tests.Cli/Commands/Index/IndexListTaxonomyStatsCommandTest.cs
index 4b35516..0fc7994 100644
--- a/src/tools/Lucene.Net.Tests.Cli/Commands/Index/IndexListTaxonomyStatsCommandTest.cs
+++ b/src/tools/Lucene.Net.Tests.Cli/Commands/Index/IndexListTaxonomyStatsCommandTest.cs
@@ -1,4 +1,5 @@
-using Lucene.Net.Cli.CommandLine;
+using Lucene.Net.Attributes;
+using Lucene.Net.Cli.CommandLine;
 using NUnit.Framework;
 using System.Collections.Generic;
 
@@ -50,6 +51,7 @@ namespace Lucene.Net.Cli.Commands
         /// Ensures the current working directory is used when index directory is not supplied. 
         /// </summary>
         [Test]
+        [LuceneNetSpecific]
         public virtual void TestNoArguments()
         {
             System.IO.Directory.SetCurrentDirectory(@"C:\");
@@ -57,6 +59,7 @@ namespace Lucene.Net.Cli.Commands
         }
 
         [Test]
+        [LuceneNetSpecific]
         public virtual void TestTooManyArguments()
         {
             Assert.Throws<CommandParsingException>(() => AssertConsoleOutput("one two", ""));

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/f17e8b7a/src/tools/Lucene.Net.Tests.Cli/Commands/Index/IndexListTermInfoCommandTest.cs
----------------------------------------------------------------------
diff --git a/src/tools/Lucene.Net.Tests.Cli/Commands/Index/IndexListTermInfoCommandTest.cs b/src/tools/Lucene.Net.Tests.Cli/Commands/Index/IndexListTermInfoCommandTest.cs
index 1b97cf2..2bfdcff 100644
--- a/src/tools/Lucene.Net.Tests.Cli/Commands/Index/IndexListTermInfoCommandTest.cs
+++ b/src/tools/Lucene.Net.Tests.Cli/Commands/Index/IndexListTermInfoCommandTest.cs
@@ -1,4 +1,5 @@
-using Lucene.Net.Cli.CommandLine;
+using Lucene.Net.Attributes;
+using Lucene.Net.Cli.CommandLine;
 using NUnit.Framework;
 using System.Collections.Generic;
 
@@ -46,12 +47,14 @@ namespace Lucene.Net.Cli.Commands
         }
 
         [Test]
+        [LuceneNetSpecific]
         public virtual void TestNotEnoughArguments()
         {
             AssertConsoleOutput("", FromResource("NotEnoughArguments", 3));
         }
 
         [Test]
+        [LuceneNetSpecific]
         public virtual void TestTooManyArguments()
         {
             Assert.Throws<CommandParsingException>(() => AssertConsoleOutput("one two three four", ""));

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/f17e8b7a/src/tools/Lucene.Net.Tests.Cli/Commands/Index/IndexMergeCommandTest.cs
----------------------------------------------------------------------
diff --git a/src/tools/Lucene.Net.Tests.Cli/Commands/Index/IndexMergeCommandTest.cs b/src/tools/Lucene.Net.Tests.Cli/Commands/Index/IndexMergeCommandTest.cs
index 7dba980..5a69565 100644
--- a/src/tools/Lucene.Net.Tests.Cli/Commands/Index/IndexMergeCommandTest.cs
+++ b/src/tools/Lucene.Net.Tests.Cli/Commands/Index/IndexMergeCommandTest.cs
@@ -1,4 +1,5 @@
-using NUnit.Framework;
+using Lucene.Net.Attributes;
+using NUnit.Framework;
 using System.Collections.Generic;
 
 namespace Lucene.Net.Cli.Commands
@@ -48,6 +49,7 @@ namespace Lucene.Net.Cli.Commands
         }
 
         [Test]
+        [LuceneNetSpecific]
         public virtual void TestNotEnoughArguments()
         {
             AssertConsoleOutput("", FromResource("NotEnoughArguments", 3));

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/f17e8b7a/src/tools/Lucene.Net.Tests.Cli/Commands/Index/IndexSplitCommandTest.cs
----------------------------------------------------------------------
diff --git a/src/tools/Lucene.Net.Tests.Cli/Commands/Index/IndexSplitCommandTest.cs b/src/tools/Lucene.Net.Tests.Cli/Commands/Index/IndexSplitCommandTest.cs
index a6a1a95..efef607 100644
--- a/src/tools/Lucene.Net.Tests.Cli/Commands/Index/IndexSplitCommandTest.cs
+++ b/src/tools/Lucene.Net.Tests.Cli/Commands/Index/IndexSplitCommandTest.cs
@@ -1,4 +1,5 @@
-using NUnit.Framework;
+using Lucene.Net.Attributes;
+using NUnit.Framework;
 using System.Collections.Generic;
 using System.Linq;
 
@@ -54,6 +55,7 @@ namespace Lucene.Net.Cli.Commands
         }
 
         [Test]
+        [LuceneNetSpecific]
         public override void TestAllValidCombinations()
         {
             var requiredArgs = GetRequiredArgs().ExpandArgs().RequiredParameters();
@@ -87,6 +89,7 @@ namespace Lucene.Net.Cli.Commands
         }
 
         [Test]
+        [LuceneNetSpecific]
         public virtual void TestNotEnoughArguments()
         {
             AssertConsoleOutput("", FromResource("NotEnoughArguments", 2));

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/f17e8b7a/src/tools/Lucene.Net.Tests.Cli/Commands/Index/IndexUpgradeCommandTest.cs
----------------------------------------------------------------------
diff --git a/src/tools/Lucene.Net.Tests.Cli/Commands/Index/IndexUpgradeCommandTest.cs b/src/tools/Lucene.Net.Tests.Cli/Commands/Index/IndexUpgradeCommandTest.cs
index 547fbab..1568c35 100644
--- a/src/tools/Lucene.Net.Tests.Cli/Commands/Index/IndexUpgradeCommandTest.cs
+++ b/src/tools/Lucene.Net.Tests.Cli/Commands/Index/IndexUpgradeCommandTest.cs
@@ -1,4 +1,5 @@
-using Lucene.Net.Cli.CommandLine;
+using Lucene.Net.Attributes;
+using Lucene.Net.Cli.CommandLine;
 using Lucene.Net.Index;
 using Lucene.Net.Store;
 using NUnit.Framework;
@@ -54,6 +55,7 @@ namespace Lucene.Net.Cli.Commands
         /// Ensures the current working directory is used when index directory is not supplied. 
         /// </summary>
         [Test]
+        [LuceneNetSpecific]
         public virtual void TestNoArguments()
         {
             System.IO.Directory.SetCurrentDirectory(@"C:\");
@@ -61,6 +63,7 @@ namespace Lucene.Net.Cli.Commands
         }
 
         [Test]
+        [LuceneNetSpecific]
         public virtual void TestTooManyArguments()
         {
             Assert.Throws<CommandParsingException>(() => AssertConsoleOutput("one two", ""));
@@ -70,6 +73,7 @@ namespace Lucene.Net.Cli.Commands
         /// Integration test to ensure --verbose argument is passed through and parsed correctly by IndexUpgrader
         /// </summary>
         [Test]
+        [LuceneNetSpecific]
         public virtual void TestPassingVerboseArgument()
         {
             MockConsoleApp output;
@@ -92,6 +96,7 @@ namespace Lucene.Net.Cli.Commands
         /// Integration test to ensure --delete-prior-commits argument is passed through and parsed correctly by IndexUpgrader
         /// </summary>
         [Test]
+        [LuceneNetSpecific]
         public virtual void TestPassingDeletePriorCommitsArgument()
         {
             MockConsoleApp output;
@@ -114,6 +119,7 @@ namespace Lucene.Net.Cli.Commands
         /// Integration test to ensure --directory-type argument is passed through and parsed correctly by IndexUpgrader
         /// </summary>
         [Test]
+        [LuceneNetSpecific]
         public virtual void TestPassingDirectoryTypeArgument()
         {
             MockConsoleApp output;

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/f17e8b7a/src/tools/Lucene.Net.Tests.Cli/Commands/Lock/LockCommandTest.cs
----------------------------------------------------------------------
diff --git a/src/tools/Lucene.Net.Tests.Cli/Commands/Lock/LockCommandTest.cs b/src/tools/Lucene.Net.Tests.Cli/Commands/Lock/LockCommandTest.cs
index 9ac8c04..b2c7740 100644
--- a/src/tools/Lucene.Net.Tests.Cli/Commands/Lock/LockCommandTest.cs
+++ b/src/tools/Lucene.Net.Tests.Cli/Commands/Lock/LockCommandTest.cs
@@ -1,4 +1,5 @@
-using Lucene.Net.Cli.CommandLine;
+using Lucene.Net.Attributes;
+using Lucene.Net.Cli.CommandLine;
 using NUnit.Framework;
 using System.Collections.Generic;
 
@@ -42,12 +43,14 @@ namespace Lucene.Net.Cli.Commands
         /// Ensures the current working directory is used when index directory is not supplied. 
         /// </summary>
         [Test]
+        [LuceneNetSpecific]
         public virtual void TestNoArguments()
         {
             AssertConsoleOutput("", "Lucene.Net Command Line Utility, Version");
         }
 
         [Test]
+        [LuceneNetSpecific]
         public virtual void TestTooManyArguments()
         {
             Assert.Throws<CommandParsingException>(() => AssertConsoleOutput("one", ""));

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/f17e8b7a/src/tools/Lucene.Net.Tests.Cli/Commands/Lock/LockStressTestCommandTest.cs
----------------------------------------------------------------------
diff --git a/src/tools/Lucene.Net.Tests.Cli/Commands/Lock/LockStressTestCommandTest.cs b/src/tools/Lucene.Net.Tests.Cli/Commands/Lock/LockStressTestCommandTest.cs
index 948104a..bfbdd3b 100644
--- a/src/tools/Lucene.Net.Tests.Cli/Commands/Lock/LockStressTestCommandTest.cs
+++ b/src/tools/Lucene.Net.Tests.Cli/Commands/Lock/LockStressTestCommandTest.cs
@@ -1,4 +1,5 @@
-using Lucene.Net.Cli.CommandLine;
+using Lucene.Net.Attributes;
+using Lucene.Net.Cli.CommandLine;
 using NUnit.Framework;
 using System.Collections.Generic;
 
@@ -49,12 +50,14 @@ namespace Lucene.Net.Cli.Commands
         }
 
         [Test]
+        [LuceneNetSpecific]
         public virtual void TestNotEnoughArguments()
         {
             AssertConsoleOutput("one two three four five six", FromResource("NotEnoughArguments", 7));
         }
 
         [Test]
+        [LuceneNetSpecific]
         public virtual void TestTooManyArguments()
         {
             Assert.Throws<CommandParsingException>(() => AssertConsoleOutput("one two three four five six seven eight", ""));

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/f17e8b7a/src/tools/Lucene.Net.Tests.Cli/Commands/Lock/LockVerifyServerCommandTest.cs
----------------------------------------------------------------------
diff --git a/src/tools/Lucene.Net.Tests.Cli/Commands/Lock/LockVerifyServerCommandTest.cs b/src/tools/Lucene.Net.Tests.Cli/Commands/Lock/LockVerifyServerCommandTest.cs
index 485482e..c1bc96e 100644
--- a/src/tools/Lucene.Net.Tests.Cli/Commands/Lock/LockVerifyServerCommandTest.cs
+++ b/src/tools/Lucene.Net.Tests.Cli/Commands/Lock/LockVerifyServerCommandTest.cs
@@ -1,4 +1,5 @@
-using Lucene.Net.Cli.CommandLine;
+using Lucene.Net.Attributes;
+using Lucene.Net.Cli.CommandLine;
 using NUnit.Framework;
 using System.Collections.Generic;
 
@@ -44,12 +45,14 @@ namespace Lucene.Net.Cli.Commands
         }
 
         [Test]
+        [LuceneNetSpecific]
         public virtual void TestNotEnoughArguments()
         {
             AssertConsoleOutput("one", FromResource("NotEnoughArguments", 2));
         }
 
         [Test]
+        [LuceneNetSpecific]
         public virtual void TestTooManyArguments()
         {
             Assert.Throws<CommandParsingException>(() => AssertConsoleOutput("one two three", ""));

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/f17e8b7a/src/tools/Lucene.Net.Tests.Cli/Commands/RootCommandTest.cs
----------------------------------------------------------------------
diff --git a/src/tools/Lucene.Net.Tests.Cli/Commands/RootCommandTest.cs b/src/tools/Lucene.Net.Tests.Cli/Commands/RootCommandTest.cs
index b49b697..0889b7f 100644
--- a/src/tools/Lucene.Net.Tests.Cli/Commands/RootCommandTest.cs
+++ b/src/tools/Lucene.Net.Tests.Cli/Commands/RootCommandTest.cs
@@ -1,4 +1,5 @@
-using Lucene.Net.Cli.CommandLine;
+using Lucene.Net.Attributes;
+using Lucene.Net.Cli.CommandLine;
 using NUnit.Framework;
 using System.Collections.Generic;
 
@@ -40,12 +41,14 @@ namespace Lucene.Net.Cli.Commands
         }
 
         [Test]
+        [LuceneNetSpecific]
         public virtual void TestTooManyArguments()
         {
             Assert.Throws<CommandParsingException>(() => AssertConsoleOutput("one", ""));
         }
 
         [Test]
+        [LuceneNetSpecific]
         public override void TestCommandHasDescription()
         {
             // No need to do this, it is not displayed anyway

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/f17e8b7a/src/tools/Lucene.Net.Tests.Cli/EnvironmentTest.cs
----------------------------------------------------------------------
diff --git a/src/tools/Lucene.Net.Tests.Cli/EnvironmentTest.cs b/src/tools/Lucene.Net.Tests.Cli/EnvironmentTest.cs
index 29d53c0..4a56fcd 100644
--- a/src/tools/Lucene.Net.Tests.Cli/EnvironmentTest.cs
+++ b/src/tools/Lucene.Net.Tests.Cli/EnvironmentTest.cs
@@ -1,4 +1,5 @@
-using Lucene.Net.Cli.Commands;
+using Lucene.Net.Attributes;
+using Lucene.Net.Cli.Commands;
 using NUnit.Framework;
 
 namespace Lucene.Net.Cli
@@ -6,12 +7,14 @@ namespace Lucene.Net.Cli
     public class EnvironmentTest
     {
         [Test]
+        [LuceneNetSpecific]
         public virtual void TestNotEnoughArgumentsResourceNotNull()
         {
             Assert.NotNull(CommandTestCase.FromResource("NotEnoughArguments"));
         }
 
         [Test]
+        [LuceneNetSpecific]
         public virtual void TestNotEnoughArgumentsResourceNotEmpty()
         {
             Assert.IsNotEmpty(CommandTestCase.FromResource("NotEnoughArguments"));

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/f17e8b7a/src/tools/Lucene.Net.Tests.Cli/SourceCode/SourceCodeParserTest.cs
----------------------------------------------------------------------
diff --git a/src/tools/Lucene.Net.Tests.Cli/SourceCode/SourceCodeParserTest.cs b/src/tools/Lucene.Net.Tests.Cli/SourceCode/SourceCodeParserTest.cs
index 23ae032..d7a465c 100644
--- a/src/tools/Lucene.Net.Tests.Cli/SourceCode/SourceCodeParserTest.cs
+++ b/src/tools/Lucene.Net.Tests.Cli/SourceCode/SourceCodeParserTest.cs
@@ -1,4 +1,5 @@
-using Lucene.Net.Support;
+using Lucene.Net.Attributes;
+using Lucene.Net.Support;
 using NUnit.Framework;
 using System.IO;
 using System.Reflection;
@@ -25,6 +26,7 @@ namespace Lucene.Net.Cli.SourceCode
     public class SourceCodeParserTest
     {
         [Test]
+        [LuceneNetSpecific]
         public void TestSourceCodeSectionParser()
         {
             var parser = new SourceCodeSectionParser();


[16/22] lucenenet git commit: Added missing TestApiConsistency tests to .NET Core tests

Posted by ni...@apache.org.
Added missing TestApiConsistency tests to .NET Core tests


Project: http://git-wip-us.apache.org/repos/asf/lucenenet/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucenenet/commit/fa4f034f
Tree: http://git-wip-us.apache.org/repos/asf/lucenenet/tree/fa4f034f
Diff: http://git-wip-us.apache.org/repos/asf/lucenenet/diff/fa4f034f

Branch: refs/heads/master
Commit: fa4f034fa505192388ba1a8177c522193fd078c5
Parents: 9a8c9f2
Author: Shad Storhaug <sh...@shadstorhaug.com>
Authored: Tue Jul 11 12:39:01 2017 +0700
Committer: Shad Storhaug <sh...@shadstorhaug.com>
Committed: Tue Jul 11 12:39:01 2017 +0700

----------------------------------------------------------------------
 .../Support/ApiScanTestBase.cs                  | 127 ++++++++++---------
 .../Support/TestApiConsistency.cs               |   2 +
 .../project.json                                |   7 +-
 .../Support/TestApiConsistency.cs               |   2 +
 .../project.json                                |   7 +-
 .../Support/TestApiConsistency.cs               |   2 +
 .../project.json                                |   7 +-
 .../Support/TestApiConsistency.cs               |   2 +
 .../project.json                                |   7 +-
 .../Support/TestApiConsistency.cs               |   2 +
 .../project.json                                |   6 +-
 .../Support/TestApiConsistency.cs               |   2 +
 src/Lucene.Net.Tests.Codecs/project.json        |   7 +-
 .../Support/TestApiConsistency.cs               |   2 +
 src/Lucene.Net.Tests.Expressions/project.json   |   6 +-
 .../Support/TestApiConsistency.cs               |   2 +
 src/Lucene.Net.Tests.Facet/project.json         |   7 +-
 .../Support/TestApiConsistency.cs               |   2 +
 src/Lucene.Net.Tests.Grouping/project.json      |   7 +-
 .../Support/TestApiConsistency.cs               |   2 +
 src/Lucene.Net.Tests.Highlighter/project.json   |   7 +-
 .../Support/TestApiConsistency.cs               |   2 +
 src/Lucene.Net.Tests.ICU/project.json           |   3 -
 .../Support/TestApiConsistency.cs               |   2 +
 src/Lucene.Net.Tests.Join/project.json          |   6 +-
 .../Support/TestApiConsistency.cs               |   2 +
 src/Lucene.Net.Tests.Memory/project.json        |   6 +-
 .../Support/TestApiConsistency.cs               |   2 +
 src/Lucene.Net.Tests.Misc/project.json          |   6 +-
 .../Support/TestApiConsistency.cs               |   2 +
 src/Lucene.Net.Tests.Queries/project.json       |   6 +-
 .../Support/TestApiConsistency.cs               |   2 +
 src/Lucene.Net.Tests.QueryParser/project.json   |   3 +-
 .../Support/TestApiConsistency.cs               |   2 +
 src/Lucene.Net.Tests.Sandbox/project.json       |   6 +-
 .../Support/TestApiConsistency.cs               |   2 +
 src/Lucene.Net.Tests.Spatial/project.json       |   7 +-
 .../Support/TestApiConsistency.cs               |   2 +
 src/Lucene.Net.Tests.Suggest/project.json       |   7 +-
 .../Support/TestApiConsistency.cs               |   2 +
 src/Lucene.Net.Tests/project.json               |   1 -
 41 files changed, 123 insertions(+), 163 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucenenet/blob/fa4f034f/src/Lucene.Net.TestFramework/Support/ApiScanTestBase.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.TestFramework/Support/ApiScanTestBase.cs b/src/Lucene.Net.TestFramework/Support/ApiScanTestBase.cs
index b754f16..8f389cb 100644
--- a/src/Lucene.Net.TestFramework/Support/ApiScanTestBase.cs
+++ b/src/Lucene.Net.TestFramework/Support/ApiScanTestBase.cs
@@ -19,7 +19,6 @@
  *
 */
 
-#if !NETSTANDARD
 using Lucene.Net.Util;
 using NUnit.Framework;
 using System;
@@ -94,7 +93,7 @@ namespace Lucene.Net.Support
         //[Test, LuceneNetSpecific]
         public virtual void TestProtectedFieldNames(Type typeFromTargetAssembly)
         {
-            var names = GetInvalidProtectedFields(typeFromTargetAssembly.Assembly);
+            var names = GetInvalidProtectedFields(typeFromTargetAssembly.GetTypeInfo().Assembly);
 
             //if (VERBOSE)
             //{
@@ -117,7 +116,7 @@ namespace Lucene.Net.Support
         //[Test, LuceneNetSpecific]
         public virtual void TestPrivateFieldNames(Type typeFromTargetAssembly, string exceptionRegex)
         {
-            var names = GetInvalidPrivateFields(typeFromTargetAssembly.Assembly, exceptionRegex);
+            var names = GetInvalidPrivateFields(typeFromTargetAssembly.GetTypeInfo().Assembly, exceptionRegex);
 
             //if (VERBOSE)
             //{
@@ -134,7 +133,7 @@ namespace Lucene.Net.Support
         //[Test, LuceneNetSpecific]
         public virtual void TestPublicFields(Type typeFromTargetAssembly)
         {
-            var names = GetInvalidPublicFields(typeFromTargetAssembly.Assembly);
+            var names = GetInvalidPublicFields(typeFromTargetAssembly.GetTypeInfo().Assembly);
 
             //if (VERBOSE)
             //{
@@ -151,7 +150,7 @@ namespace Lucene.Net.Support
         //[Test, LuceneNetSpecific]
         public virtual void TestMethodParameterNames(Type typeFromTargetAssembly)
         {
-            var names = GetInvalidMethodParameterNames(typeFromTargetAssembly.Assembly);
+            var names = GetInvalidMethodParameterNames(typeFromTargetAssembly.GetTypeInfo().Assembly);
 
             //if (VERBOSE)
             //{
@@ -168,7 +167,7 @@ namespace Lucene.Net.Support
         //[Test, LuceneNetSpecific]
         public virtual void TestInterfaceNames(Type typeFromTargetAssembly)
         {
-            var names = GetInvalidInterfaceNames(typeFromTargetAssembly.Assembly);
+            var names = GetInvalidInterfaceNames(typeFromTargetAssembly.GetTypeInfo().Assembly);
 
             //if (VERBOSE)
             //{
@@ -185,7 +184,7 @@ namespace Lucene.Net.Support
         //[Test, LuceneNetSpecific]
         public virtual void TestClassNames(Type typeFromTargetAssembly)
         {
-            var names = GetInvalidClassNames(typeFromTargetAssembly.Assembly);
+            var names = GetInvalidClassNames(typeFromTargetAssembly.GetTypeInfo().Assembly);
 
             //if (VERBOSE)
             //{
@@ -203,7 +202,7 @@ namespace Lucene.Net.Support
         //[Test, LuceneNetSpecific]
         public virtual void TestForPropertiesWithNoGetter(Type typeFromTargetAssembly)
         {
-            var names = GetPropertiesWithNoGetter(typeFromTargetAssembly.Assembly);
+            var names = GetPropertiesWithNoGetter(typeFromTargetAssembly.GetTypeInfo().Assembly);
 
             //if (VERBOSE)
             //{
@@ -221,7 +220,7 @@ namespace Lucene.Net.Support
         //[Test, LuceneNetSpecific]
         public virtual void TestForPropertiesThatReturnArray(Type typeFromTargetAssembly)
         {
-            var names = GetPropertiesThatReturnArray(typeFromTargetAssembly.Assembly);
+            var names = GetPropertiesThatReturnArray(typeFromTargetAssembly.GetTypeInfo().Assembly);
 
             //if (VERBOSE)
             //{
@@ -238,10 +237,11 @@ namespace Lucene.Net.Support
                 "the consumer if the array is not cloned using arr.ToArray().");
         }
 
+#if !NETSTANDARD
         //[Test, LuceneNetSpecific]
         public virtual void TestForMethodsThatReturnWritableArray(Type typeFromTargetAssembly)
         {
-            var names = GetMethodsThatReturnWritableArray(typeFromTargetAssembly.Assembly);
+            var names = GetMethodsThatReturnWritableArray(typeFromTargetAssembly.GetTypeInfo().Assembly);
 
             //if (VERBOSE)
             //{
@@ -255,14 +255,15 @@ namespace Lucene.Net.Support
                 "An array should be cloned before returning using arr.ToArray() or if it is intended to be writable, " +
                 "decorate with the WritableArray attribute and consider making it a property for clarity.");
         }
+#endif
 
         //[Test, LuceneNetSpecific]
         public virtual void TestForPublicMembersContainingComparer(Type typeFromTargetAssembly)
         {
             var names = new List<string>();
 
-            names.AddRange(GetProtectedFieldsContainingComparer(typeFromTargetAssembly.Assembly));
-            names.AddRange(GetMembersContainingComparer(typeFromTargetAssembly.Assembly));
+            names.AddRange(GetProtectedFieldsContainingComparer(typeFromTargetAssembly.GetTypeInfo().Assembly));
+            names.AddRange(GetMembersContainingComparer(typeFromTargetAssembly.GetTypeInfo().Assembly));
 
             //if (VERBOSE)
             //{
@@ -279,7 +280,7 @@ namespace Lucene.Net.Support
         //[Test, LuceneNetSpecific]
         public virtual void TestForPublicMembersNamedSize(Type typeFromTargetAssembly)
         {
-            var names = GetMembersNamedSize(typeFromTargetAssembly.Assembly);
+            var names = GetMembersNamedSize(typeFromTargetAssembly.GetTypeInfo().Assembly);
 
             //if (VERBOSE)
             //{
@@ -299,7 +300,7 @@ namespace Lucene.Net.Support
         //[Test, LuceneNetSpecific]
         public virtual void TestForPublicMembersContainingNonNetNumeric(Type typeFromTargetAssembly)
         {
-            var names = GetMembersContainingNonNetNumeric(typeFromTargetAssembly.Assembly);
+            var names = GetMembersContainingNonNetNumeric(typeFromTargetAssembly.GetTypeInfo().Assembly);
 
             //if (VERBOSE)
             //{
@@ -317,7 +318,7 @@ namespace Lucene.Net.Support
         //[Test, LuceneNetSpecific]
         public virtual void TestForTypesContainingNonNetNumeric(Type typeFromTargetAssembly)
         {
-            var names = GetTypesContainingNonNetNumeric(typeFromTargetAssembly.Assembly);
+            var names = GetTypesContainingNonNetNumeric(typeFromTargetAssembly.GetTypeInfo().Assembly);
 
             //if (VERBOSE)
             //{
@@ -336,7 +337,7 @@ namespace Lucene.Net.Support
         //[Test, LuceneNetSpecific]
         public virtual void TestForPublicMembersWithNullableEnum(Type typeFromTargetAssembly)
         {
-            var names = GetPublicNullableEnumMembers(typeFromTargetAssembly.Assembly);
+            var names = GetPublicNullableEnumMembers(typeFromTargetAssembly.GetTypeInfo().Assembly);
 
             //if (VERBOSE)
             //{
@@ -361,7 +362,7 @@ namespace Lucene.Net.Support
         //[Test, LuceneNetSpecific]
         public virtual void TestForMembersAcceptingOrReturningIEnumerable(Type typeFromTargetAssembly, string exceptionRegex)
         {
-            var names = GetMembersAcceptingOrReturningType(typeof(IEnumerable<>), typeFromTargetAssembly.Assembly, false, exceptionRegex);
+            var names = GetMembersAcceptingOrReturningType(typeof(IEnumerable<>), typeFromTargetAssembly.GetTypeInfo().Assembly, false, exceptionRegex);
 
             //if (VERBOSE)
             //{
@@ -384,8 +385,8 @@ namespace Lucene.Net.Support
         public virtual void TestForMembersAcceptingOrReturningListOrDictionary(Type typeFromTargetAssembly, string exceptionRegex)
         {
             var names = new List<string>();
-            names.AddRange(GetMembersAcceptingOrReturningType(typeof(List<>), typeFromTargetAssembly.Assembly, true, exceptionRegex));
-            names.AddRange(GetMembersAcceptingOrReturningType(typeof(Dictionary<,>), typeFromTargetAssembly.Assembly, true, exceptionRegex));
+            names.AddRange(GetMembersAcceptingOrReturningType(typeof(List<>), typeFromTargetAssembly.GetTypeInfo().Assembly, true, exceptionRegex));
+            names.AddRange(GetMembersAcceptingOrReturningType(typeof(Dictionary<,>), typeFromTargetAssembly.GetTypeInfo().Assembly, true, exceptionRegex));
 
             //if (VERBOSE)
             //{
@@ -403,7 +404,7 @@ namespace Lucene.Net.Support
         {
             var result = new List<string>();
 
-            var classes = assembly.GetTypes().Where(t => t.IsClass);
+            var classes = assembly.GetTypes().Where(t => t.GetTypeInfo().IsClass);
 
             foreach (var c in classes)
             {
@@ -421,7 +422,7 @@ namespace Lucene.Net.Support
                         continue;
                     }
 
-                    if ((field.IsPrivate || field.IsAssembly) && !PrivateFieldName.IsMatch(field.Name) && field.DeclaringType.Equals(c.UnderlyingSystemType))
+                    if ((field.IsPrivate || field.IsAssembly) && !PrivateFieldName.IsMatch(field.Name) && field.DeclaringType.Equals(c.GetTypeInfo().UnderlyingSystemType))
                     {
                         var name = string.Concat(c.FullName, ".", field.Name);
                         //bool hasExceptions = !string.IsNullOrWhiteSpace(exceptionRegex);
@@ -444,7 +445,7 @@ namespace Lucene.Net.Support
         {
             var result = new List<string>();
 
-            var classes = assembly.GetTypes().Where(t => t.IsClass);
+            var classes = assembly.GetTypes().Where(t => t.GetTypeInfo().IsClass);
 
             foreach (var c in classes)
             {
@@ -467,7 +468,7 @@ namespace Lucene.Net.Support
                         continue;
                     }
 
-                    if ((field.IsFamily || field.IsFamilyOrAssembly) && !ProtectedFieldName.IsMatch(field.Name) && field.DeclaringType.Equals(c.UnderlyingSystemType))
+                    if ((field.IsFamily || field.IsFamilyOrAssembly) && !ProtectedFieldName.IsMatch(field.Name) && field.DeclaringType.Equals(c.GetTypeInfo().UnderlyingSystemType))
                     {
                         result.Add(string.Concat(c.FullName, ".", field.Name));
                     }
@@ -486,7 +487,7 @@ namespace Lucene.Net.Support
         {
             var result = new List<string>();
 
-            var classes = assembly.GetTypes().Where(t => t.IsClass);
+            var classes = assembly.GetTypes().Where(t => t.GetTypeInfo().IsClass);
 
             foreach (var c in classes)
             {
@@ -514,7 +515,7 @@ namespace Lucene.Net.Support
                         continue;
                     }
 
-                    if (field.IsPublic && field.DeclaringType.Equals(c.UnderlyingSystemType))
+                    if (field.IsPublic && field.DeclaringType.Equals(c.GetTypeInfo().UnderlyingSystemType))
                     {
                         result.Add(string.Concat(c.FullName, ".", field.Name));
                     }
@@ -528,7 +529,7 @@ namespace Lucene.Net.Support
         {
             var result = new List<string>();
 
-            var classes = assembly.GetTypes().Where(t => t.IsClass);
+            var classes = assembly.GetTypes().Where(t => t.GetTypeInfo().IsClass);
 
             foreach (var c in classes)
             {
@@ -545,7 +546,7 @@ namespace Lucene.Net.Support
 
                     foreach (var parameter in parameters)
                     {
-                        if (!MethodParameterName.IsMatch(parameter.Name) && method.DeclaringType.Equals(c.UnderlyingSystemType))
+                        if (!MethodParameterName.IsMatch(parameter.Name) && method.DeclaringType.Equals(c.GetTypeInfo().UnderlyingSystemType))
                         {
                             result.Add(string.Concat(c.FullName, ".", method.Name, " -parameter- ", parameter.Name));
                         }
@@ -560,7 +561,7 @@ namespace Lucene.Net.Support
         {
             var result = new List<string>();
 
-            var interfaces = assembly.GetTypes().Where(t => t.IsInterface);
+            var interfaces = assembly.GetTypes().Where(t => t.GetTypeInfo().IsInterface);
 
             foreach (var i in interfaces)
             {
@@ -577,7 +578,7 @@ namespace Lucene.Net.Support
         {
             var result = new List<string>();
 
-            var classes = assembly.GetTypes().Where(t => t.IsClass);
+            var classes = assembly.GetTypes().Where(t => t.GetTypeInfo().IsClass);
 
             foreach (var c in classes)
             {
@@ -586,7 +587,7 @@ namespace Lucene.Net.Support
                     continue;
                 }
 
-                if (System.Attribute.IsDefined(c, typeof(ExceptionToClassNameConventionAttribute)))
+                if (c.GetTypeInfo().IsDefined(typeof(ExceptionToClassNameConventionAttribute)))
                 {
                     continue;
                 }
@@ -604,7 +605,7 @@ namespace Lucene.Net.Support
         {
             var result = new List<string>();
 
-            var classes = assembly.GetTypes().Where(t => t.IsClass);
+            var classes = assembly.GetTypes().Where(t => t.GetTypeInfo().IsClass);
 
             foreach (var c in classes)
             {
@@ -612,7 +613,7 @@ namespace Lucene.Net.Support
 
                 foreach (var property in properties)
                 {
-                    if (property.GetSetMethod(true) != null && property.GetGetMethod(true) == null && property.DeclaringType.Equals(c.UnderlyingSystemType))
+                    if (property.GetSetMethod(true) != null && property.GetGetMethod(true) == null && property.DeclaringType.Equals(c.GetTypeInfo().UnderlyingSystemType))
                     {
                         result.Add(string.Concat(c.FullName, ".", property.Name));
                     }
@@ -626,7 +627,7 @@ namespace Lucene.Net.Support
         {
             var result = new List<string>();
 
-            var classes = assembly.GetTypes().Where(t => t.IsClass);
+            var classes = assembly.GetTypes().Where(t => t.GetTypeInfo().IsClass);
 
             foreach (var c in classes)
             {
@@ -638,14 +639,14 @@ namespace Lucene.Net.Support
                     // properties that were intended to expose arrays, as per MSDN this
                     // is not a .NET best practice. However, Lucene's design requires that
                     // this be done.
-                    if (System.Attribute.IsDefined(property, typeof(WritableArrayAttribute)))
+                    if (property.IsDefined(typeof(WritableArrayAttribute)))
                     {
                         continue;
                     }
 
                     var getMethod = property.GetGetMethod();
                     
-                    if (getMethod != null && getMethod.ReturnParameter != null && getMethod.ReturnParameter.ParameterType.IsArray && property.DeclaringType.Equals(c.UnderlyingSystemType))
+                    if (getMethod != null && getMethod.ReturnParameter != null && getMethod.ReturnParameter.ParameterType.IsArray && property.DeclaringType.Equals(c.GetTypeInfo().UnderlyingSystemType))
                     {
                         result.Add(string.Concat(c.FullName, ".", property.Name));
                     }
@@ -660,7 +661,7 @@ namespace Lucene.Net.Support
         {
             var result = new List<string>();
 
-            var classes = assembly.GetTypes().Where(t => t.IsClass);
+            var classes = assembly.GetTypes().Where(t => t.GetTypeInfo().IsClass);
 
             foreach (var c in classes)
             {
@@ -678,7 +679,7 @@ namespace Lucene.Net.Support
                         continue;
                     }
 
-                    if ((field.IsFamily || field.IsFamilyOrAssembly) && ContainsComparer.IsMatch(field.Name) && field.DeclaringType.Equals(c.UnderlyingSystemType))
+                    if ((field.IsFamily || field.IsFamilyOrAssembly) && ContainsComparer.IsMatch(field.Name) && field.DeclaringType.Equals(c.GetTypeInfo().UnderlyingSystemType))
                     {
                         result.Add(string.Concat(c.FullName, ".", field.Name));
                     }
@@ -696,7 +697,7 @@ namespace Lucene.Net.Support
 
             foreach (var t in types)
             {
-                if (ContainsComparer.IsMatch(t.Name) && t.IsVisible)
+                if (ContainsComparer.IsMatch(t.Name) && t.GetTypeInfo().IsVisible)
                 {
                     result.Add(t.FullName);
                 }
@@ -705,7 +706,7 @@ namespace Lucene.Net.Support
 
                 foreach (var member in members)
                 {
-                    if (ContainsComparer.IsMatch(member.Name) && member.DeclaringType.Equals(t.UnderlyingSystemType))
+                    if (ContainsComparer.IsMatch(member.Name) && member.DeclaringType.Equals(t.GetTypeInfo().UnderlyingSystemType))
                     {
                         if (member.MemberType == MemberTypes.Method && !(member.Name.StartsWith("get_", StringComparison.Ordinal) || member.Name.StartsWith("set_", StringComparison.Ordinal)))
                         {
@@ -738,7 +739,7 @@ namespace Lucene.Net.Support
 
                 foreach (var member in members)
                 {
-                    if ("Size".Equals(member.Name, StringComparison.OrdinalIgnoreCase) && member.DeclaringType.Equals(t.UnderlyingSystemType))
+                    if ("Size".Equals(member.Name, StringComparison.OrdinalIgnoreCase) && member.DeclaringType.Equals(t.GetTypeInfo().UnderlyingSystemType))
                     {
                         if (member.MemberType == MemberTypes.Method && !(member.Name.StartsWith("get_", StringComparison.Ordinal) || member.Name.StartsWith("set_", StringComparison.Ordinal)))
                         {
@@ -779,12 +780,12 @@ namespace Lucene.Net.Support
                 foreach (var member in members)
                 {
                     // Ignore properties, methods, and events with IgnoreNetNumericConventionAttribute
-                    if (System.Attribute.IsDefined(member, typeof(ExceptionToNetNumericConventionAttribute)))
+                    if (member.IsDefined(typeof(ExceptionToNetNumericConventionAttribute)))
                     {
                         continue;
                     }
 
-                    if (ContainsNonNetNumeric.IsMatch(member.Name) && member.DeclaringType.Equals(t.UnderlyingSystemType))
+                    if (ContainsNonNetNumeric.IsMatch(member.Name) && member.DeclaringType.Equals(t.GetTypeInfo().UnderlyingSystemType))
                     {
                         if (member.MemberType == MemberTypes.Method && !(member.Name.StartsWith("get_", StringComparison.Ordinal) || member.Name.StartsWith("set_", StringComparison.Ordinal)))
                         {
@@ -822,11 +823,12 @@ namespace Lucene.Net.Support
             return result.ToArray();
         }
 
+#if !NETSTANDARD
         private static IEnumerable<string> GetMethodsThatReturnWritableArray(Assembly assembly)
         {
             var result = new List<string>();
 
-            var classes = assembly.GetTypes().Where(t => t.IsClass);
+            var classes = assembly.GetTypes().Where(t => t.GetTypeInfo().IsClass);
 
             foreach (var c in classes)
             {
@@ -843,7 +845,7 @@ namespace Lucene.Net.Support
                     // properties that were intended to expose arrays, as per MSDN this
                     // is not a .NET best practice. However, Lucene's design requires that
                     // this be done.
-                    if (System.Attribute.IsDefined(method, typeof(WritableArrayAttribute)))
+                    if (method.IsDefined(typeof(WritableArrayAttribute)))
                     {
                         continue;
                     }
@@ -856,8 +858,9 @@ namespace Lucene.Net.Support
 
                     if (method != null && method.ReturnParameter != null 
                         && method.ReturnParameter.ParameterType.IsArray 
-                        && method.DeclaringType.Equals(c.UnderlyingSystemType))
+                        && method.DeclaringType.Equals(c.GetTypeInfo().UnderlyingSystemType))
                     {
+
                         var methodBody = method.GetMethodBody();
                         if (methodBody != null)
                         {
@@ -874,6 +877,7 @@ namespace Lucene.Net.Support
 
             return result.ToArray();
         }
+#endif
 
         private static IEnumerable<string> GetPublicNullableEnumMembers(Assembly assembly)
         {
@@ -893,12 +897,12 @@ namespace Lucene.Net.Support
                     }
 
                     // Ignore properties, methods, and events with IgnoreNetNumericConventionAttribute
-                    if (System.Attribute.IsDefined(member, typeof(ExceptionToNullableEnumConvention)))
+                    if (member.IsDefined(typeof(ExceptionToNullableEnumConvention)))
                     {
                         continue;
                     }
 
-                    if (member.DeclaringType.Equals(t.UnderlyingSystemType))
+                    if (member.DeclaringType.Equals(t.GetTypeInfo().UnderlyingSystemType))
                     {
                         if (member.MemberType == MemberTypes.Method && !(member.Name.StartsWith("get_", StringComparison.Ordinal) || member.Name.StartsWith("set_", StringComparison.Ordinal)))
                         {
@@ -908,7 +912,7 @@ namespace Lucene.Net.Support
                             {
                                 if (method.ReturnParameter != null
                                     && Nullable.GetUnderlyingType(method.ReturnParameter.ParameterType) != null
-                                    && method.ReturnParameter.ParameterType.GetGenericArguments()[0].IsEnum)
+                                    && method.ReturnParameter.ParameterType.GetGenericArguments()[0].GetTypeInfo().IsEnum)
                                 {
                                     result.Add(string.Concat(t.FullName, ".", member.Name, "()"));
                                 }
@@ -918,8 +922,8 @@ namespace Lucene.Net.Support
                                 foreach (var parameter in parameters)
                                 {
                                     if (Nullable.GetUnderlyingType(parameter.ParameterType) != null
-                                        && parameter.ParameterType.GetGenericArguments()[0].IsEnum
-                                        && member.DeclaringType.Equals(t.UnderlyingSystemType))
+                                        && parameter.ParameterType.GetGenericArguments()[0].GetTypeInfo().IsEnum
+                                        && member.DeclaringType.Equals(t.GetTypeInfo().UnderlyingSystemType))
                                     {
                                         result.Add(string.Concat(t.FullName, ".", member.Name, "()", " -parameter- ", parameter.Name));
                                     }
@@ -937,8 +941,8 @@ namespace Lucene.Net.Support
                                 foreach (var parameter in parameters)
                                 {
                                     if (Nullable.GetUnderlyingType(parameter.ParameterType) != null
-                                        && parameter.ParameterType.GetGenericArguments()[0].IsEnum
-                                        && member.DeclaringType.Equals(t.UnderlyingSystemType))
+                                        && parameter.ParameterType.GetGenericArguments()[0].GetTypeInfo().IsEnum
+                                        && member.DeclaringType.Equals(t.GetTypeInfo().UnderlyingSystemType))
                                     {
                                         result.Add(string.Concat(t.FullName, ".", member.Name, "()", " -parameter- ", parameter.Name));
                                     }
@@ -947,14 +951,14 @@ namespace Lucene.Net.Support
                         }
                         else if (member.MemberType == MemberTypes.Property 
                             && Nullable.GetUnderlyingType(((PropertyInfo)member).PropertyType) != null 
-                            && ((PropertyInfo)member).PropertyType.GetGenericArguments()[0].IsEnum 
+                            && ((PropertyInfo)member).PropertyType.GetGenericArguments()[0].GetTypeInfo().IsEnum 
                             && IsNonPrivateProperty((PropertyInfo)member))
                         {
                             result.Add(string.Concat(t.FullName, ".", member.Name));
                         }
                         else if (member.MemberType == MemberTypes.Field 
                             && Nullable.GetUnderlyingType(((FieldInfo)member).FieldType) != null 
-                            && ((FieldInfo)member).FieldType.GetGenericArguments()[0].IsEnum 
+                            && ((FieldInfo)member).FieldType.GetGenericArguments()[0].GetTypeInfo().IsEnum 
                             && (((FieldInfo)member).IsFamily || ((FieldInfo)member).IsFamilyOrAssembly))
                         {
                             result.Add(string.Concat(t.FullName, ".", member.Name, " (field)"));
@@ -1004,7 +1008,7 @@ namespace Lucene.Net.Support
                         continue;
                     }
 
-                    if (member.DeclaringType.Equals(t.UnderlyingSystemType))
+                    if (member.DeclaringType.Equals(t.GetTypeInfo().UnderlyingSystemType))
                     {
                         if (member.MemberType == MemberTypes.Method && !(member.Name.StartsWith("get_", StringComparison.Ordinal) || member.Name.StartsWith("set_", StringComparison.Ordinal)))
                         {
@@ -1014,7 +1018,7 @@ namespace Lucene.Net.Support
                             {
 
                                 if (method.ReturnParameter != null
-                                    && method.ReturnParameter.ParameterType.IsGenericType
+                                    && method.ReturnParameter.ParameterType.GetTypeInfo().IsGenericType
                                     && method.ReturnParameter.ParameterType.GetGenericTypeDefinition().IsAssignableFrom(lookFor))
                                 {
                                     var name = string.Concat(t.FullName, ".", member.Name, "()");
@@ -1029,9 +1033,9 @@ namespace Lucene.Net.Support
 
                                 foreach (var parameter in parameters)
                                 {
-                                    if (parameter.ParameterType.IsGenericType
+                                    if (parameter.ParameterType.GetTypeInfo().IsGenericType
                                         && parameter.ParameterType.GetGenericTypeDefinition().IsAssignableFrom(lookFor)
-                                        && member.DeclaringType.Equals(t.UnderlyingSystemType))
+                                        && member.DeclaringType.Equals(t.GetTypeInfo().UnderlyingSystemType))
                                     {
                                         var name = string.Concat(t.FullName, ".", member.Name, "()", " -parameter- ", parameter.Name);
 
@@ -1053,9 +1057,9 @@ namespace Lucene.Net.Support
 
                                 foreach (var parameter in parameters)
                                 {
-                                    if (parameter.ParameterType.IsGenericType
+                                    if (parameter.ParameterType.GetTypeInfo().IsGenericType
                                         && parameter.ParameterType.GetGenericTypeDefinition().IsAssignableFrom(lookFor)
-                                        && member.DeclaringType.Equals(t.UnderlyingSystemType))
+                                        && member.DeclaringType.Equals(t.GetTypeInfo().UnderlyingSystemType))
                                     {
                                         var name = string.Concat(t.FullName, ".", member.Name, "()", " -parameter- ", parameter.Name);
 
@@ -1068,7 +1072,7 @@ namespace Lucene.Net.Support
                             }
                         }
                         else if (member.MemberType == MemberTypes.Property
-                            && ((PropertyInfo)member).PropertyType.IsGenericType
+                            && ((PropertyInfo)member).PropertyType.GetTypeInfo().IsGenericType
                             && ((PropertyInfo)member).PropertyType.GetGenericTypeDefinition().IsAssignableFrom(lookFor)
                             && (!publiclyVisibleOnly || IsNonPrivateProperty((PropertyInfo)member)))
                         {
@@ -1094,4 +1098,3 @@ namespace Lucene.Net.Support
         }
     }
 }
-#endif

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/fa4f034f/src/Lucene.Net.Tests.Analysis.Common/Support/TestApiConsistency.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Support/TestApiConsistency.cs b/src/Lucene.Net.Tests.Analysis.Common/Support/TestApiConsistency.cs
index cf441de..7f65360 100644
--- a/src/Lucene.Net.Tests.Analysis.Common/Support/TestApiConsistency.cs
+++ b/src/Lucene.Net.Tests.Analysis.Common/Support/TestApiConsistency.cs
@@ -87,12 +87,14 @@ namespace Lucene.Net.Analysis
             base.TestForPropertiesThatReturnArray(typeFromTargetAssembly);
         }
 
+#if !NETSTANDARD
         [Test, LuceneNetSpecific]
         [TestCase(typeof(Lucene.Net.Analysis.Standard.ClassicAnalyzer))]
         public override void TestForMethodsThatReturnWritableArray(Type typeFromTargetAssembly)
         {
             base.TestForMethodsThatReturnWritableArray(typeFromTargetAssembly);
         }
+#endif
 
         [Test, LuceneNetSpecific]
         [TestCase(typeof(Lucene.Net.Analysis.Standard.ClassicAnalyzer))]

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/fa4f034f/src/Lucene.Net.Tests.Analysis.Common/project.json
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/project.json b/src/Lucene.Net.Tests.Analysis.Common/project.json
index 0ad7006..3a1fb1e 100644
--- a/src/Lucene.Net.Tests.Analysis.Common/project.json
+++ b/src/Lucene.Net.Tests.Analysis.Common/project.json
@@ -102,12 +102,7 @@
     "netcoreapp1.0": {
       "buildOptions": {
         "debugType": "portable",
-        "define": [ "NETSTANDARD" ],
-        "compile": {
-          "excludeFiles": [
-            "Support/TestApiConsistency.cs"
-          ]
-        }
+        "define": [ "NETSTANDARD" ]
       },
       "imports": "dnxcore50"
     },

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/fa4f034f/src/Lucene.Net.Tests.Analysis.Phonetic/Support/TestApiConsistency.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Phonetic/Support/TestApiConsistency.cs b/src/Lucene.Net.Tests.Analysis.Phonetic/Support/TestApiConsistency.cs
index 37e0f6b..875f837 100644
--- a/src/Lucene.Net.Tests.Analysis.Phonetic/Support/TestApiConsistency.cs
+++ b/src/Lucene.Net.Tests.Analysis.Phonetic/Support/TestApiConsistency.cs
@@ -87,12 +87,14 @@ namespace Lucene.Net.Analysis.Phonetic
             base.TestForPropertiesThatReturnArray(typeFromTargetAssembly);
         }
 
+#if !NETSTANDARD
         [Test, LuceneNetSpecific]
         [TestCase(typeof(Lucene.Net.Analysis.Phonetic.BeiderMorseFilter))]
         public override void TestForMethodsThatReturnWritableArray(Type typeFromTargetAssembly)
         {
             base.TestForMethodsThatReturnWritableArray(typeFromTargetAssembly);
         }
+#endif
 
         [Test, LuceneNetSpecific]
         [TestCase(typeof(Lucene.Net.Analysis.Phonetic.BeiderMorseFilter))]

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/fa4f034f/src/Lucene.Net.Tests.Analysis.Phonetic/project.json
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Phonetic/project.json b/src/Lucene.Net.Tests.Analysis.Phonetic/project.json
index 7bad539..82f8959 100644
--- a/src/Lucene.Net.Tests.Analysis.Phonetic/project.json
+++ b/src/Lucene.Net.Tests.Analysis.Phonetic/project.json
@@ -22,12 +22,7 @@
       "imports": "dnxcore50",
       "buildOptions": {
         "debugType": "portable",
-        "define": [ "NETSTANDARD" ],
-        "compile": {
-          "excludeFiles": [
-            "Support/TestApiConsistency.cs"
-          ]
-        }
+        "define": [ "NETSTANDARD" ]
       }
     },
     "net451": {

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/fa4f034f/src/Lucene.Net.Tests.Analysis.SmartCn/Support/TestApiConsistency.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.SmartCn/Support/TestApiConsistency.cs b/src/Lucene.Net.Tests.Analysis.SmartCn/Support/TestApiConsistency.cs
index 0943448..e103482 100644
--- a/src/Lucene.Net.Tests.Analysis.SmartCn/Support/TestApiConsistency.cs
+++ b/src/Lucene.Net.Tests.Analysis.SmartCn/Support/TestApiConsistency.cs
@@ -87,12 +87,14 @@ namespace Lucene.Net.Analysis.Cn.Smart.Support
             base.TestForPropertiesThatReturnArray(typeFromTargetAssembly);
         }
 
+#if !NETSTANDARD
         [Test, LuceneNetSpecific]
         [TestCase(typeof(Lucene.Net.Analysis.Cn.Smart.AnalyzerProfile))]
         public override void TestForMethodsThatReturnWritableArray(Type typeFromTargetAssembly)
         {
             base.TestForMethodsThatReturnWritableArray(typeFromTargetAssembly);
         }
+#endif
 
         [Test, LuceneNetSpecific]
         [TestCase(typeof(Lucene.Net.Analysis.Cn.Smart.AnalyzerProfile))]

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/fa4f034f/src/Lucene.Net.Tests.Analysis.SmartCn/project.json
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.SmartCn/project.json b/src/Lucene.Net.Tests.Analysis.SmartCn/project.json
index d7196a3..a9a4b47 100644
--- a/src/Lucene.Net.Tests.Analysis.SmartCn/project.json
+++ b/src/Lucene.Net.Tests.Analysis.SmartCn/project.json
@@ -22,12 +22,7 @@
       "imports": "dnxcore50",
       "buildOptions": {
         "debugType": "portable",
-        "define": [ "NETSTANDARD" ],
-        "compile": {
-          "excludeFiles": [
-            "Support/TestApiConsistency.cs"
-          ]
-        }
+        "define": [ "NETSTANDARD" ]
       }
     },
     "net451": {

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/fa4f034f/src/Lucene.Net.Tests.Analysis.Stempel/Support/TestApiConsistency.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Stempel/Support/TestApiConsistency.cs b/src/Lucene.Net.Tests.Analysis.Stempel/Support/TestApiConsistency.cs
index 3c546f5..c19c7f5 100644
--- a/src/Lucene.Net.Tests.Analysis.Stempel/Support/TestApiConsistency.cs
+++ b/src/Lucene.Net.Tests.Analysis.Stempel/Support/TestApiConsistency.cs
@@ -87,12 +87,14 @@ namespace Lucene.Net.Analysis.Stempel
             base.TestForPropertiesThatReturnArray(typeFromTargetAssembly);
         }
 
+#if !NETSTANDARD
         [Test, LuceneNetSpecific]
         [TestCase(typeof(Lucene.Net.Analysis.Stempel.StempelFilter))]
         public override void TestForMethodsThatReturnWritableArray(Type typeFromTargetAssembly)
         {
             base.TestForMethodsThatReturnWritableArray(typeFromTargetAssembly);
         }
+#endif
 
         [Test, LuceneNetSpecific]
         [TestCase(typeof(Lucene.Net.Analysis.Stempel.StempelFilter))]

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/fa4f034f/src/Lucene.Net.Tests.Analysis.Stempel/project.json
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Stempel/project.json b/src/Lucene.Net.Tests.Analysis.Stempel/project.json
index d2bcbff..463e61c 100644
--- a/src/Lucene.Net.Tests.Analysis.Stempel/project.json
+++ b/src/Lucene.Net.Tests.Analysis.Stempel/project.json
@@ -23,12 +23,7 @@
       "imports": "dnxcore50",
       "buildOptions": {
         "debugType": "portable",
-        "define": [ "NETSTANDARD" ],
-        "compile": {
-          "excludeFiles": [
-            "Support/TestApiConsistency.cs"
-          ]
-        }
+        "define": [ "NETSTANDARD" ]
       }
     },
     "net451": {

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/fa4f034f/src/Lucene.Net.Tests.Classification/Support/TestApiConsistency.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Classification/Support/TestApiConsistency.cs b/src/Lucene.Net.Tests.Classification/Support/TestApiConsistency.cs
index c72e624..98dc2db 100644
--- a/src/Lucene.Net.Tests.Classification/Support/TestApiConsistency.cs
+++ b/src/Lucene.Net.Tests.Classification/Support/TestApiConsistency.cs
@@ -87,12 +87,14 @@ namespace Lucene.Net.Classification
             base.TestForPropertiesThatReturnArray(typeFromTargetAssembly);
         }
 
+#if !NETSTANDARD
         [Test, LuceneNetSpecific]
         [TestCase(typeof(Lucene.Net.Classification.KNearestNeighborClassifier))]
         public override void TestForMethodsThatReturnWritableArray(Type typeFromTargetAssembly)
         {
             base.TestForMethodsThatReturnWritableArray(typeFromTargetAssembly);
         }
+#endif
 
         [Test, LuceneNetSpecific]
         [TestCase(typeof(Lucene.Net.Classification.KNearestNeighborClassifier))]

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/fa4f034f/src/Lucene.Net.Tests.Classification/project.json
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Classification/project.json b/src/Lucene.Net.Tests.Classification/project.json
index b804729..be13c30 100644
--- a/src/Lucene.Net.Tests.Classification/project.json
+++ b/src/Lucene.Net.Tests.Classification/project.json
@@ -19,11 +19,7 @@
       "imports": "dnxcore50",
       "buildOptions": {
         "debugType": "portable",
-        "compile": {
-          "excludeFiles": [
-            "Support/TestApiConsistency.cs"
-          ]
-        }
+        "define": [ "NETSTANDARD" ]
       }
     },
     "net451": {

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/fa4f034f/src/Lucene.Net.Tests.Codecs/Support/TestApiConsistency.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Codecs/Support/TestApiConsistency.cs b/src/Lucene.Net.Tests.Codecs/Support/TestApiConsistency.cs
index 1629622..3c01ed5 100644
--- a/src/Lucene.Net.Tests.Codecs/Support/TestApiConsistency.cs
+++ b/src/Lucene.Net.Tests.Codecs/Support/TestApiConsistency.cs
@@ -87,12 +87,14 @@ namespace Lucene.Net.Codecs.Tests
             base.TestForPropertiesThatReturnArray(typeFromTargetAssembly);
         }
 
+#if !NETSTANDARD
         [Test, LuceneNetSpecific]
         [TestCase(typeof(Lucene.Net.Codecs.BlockTerms.BlockTermsReader))]
         public override void TestForMethodsThatReturnWritableArray(Type typeFromTargetAssembly)
         {
             base.TestForMethodsThatReturnWritableArray(typeFromTargetAssembly);
         }
+#endif
 
         [Test, LuceneNetSpecific]
         [TestCase(typeof(Lucene.Net.Codecs.BlockTerms.BlockTermsReader))]

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/fa4f034f/src/Lucene.Net.Tests.Codecs/project.json
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Codecs/project.json b/src/Lucene.Net.Tests.Codecs/project.json
index 1eb7aa1..c834025 100644
--- a/src/Lucene.Net.Tests.Codecs/project.json
+++ b/src/Lucene.Net.Tests.Codecs/project.json
@@ -19,12 +19,7 @@
       "imports": "dnxcore50",
       "buildOptions": {
         "debugType": "portable",
-        "define": [ "NETSTANDARD" ],
-        "compile": {
-          "excludeFiles": [
-            "Support/TestApiConsistency.cs"
-          ]
-        }
+        "define": [ "NETSTANDARD" ]
       }
     },
     "net451": {

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/fa4f034f/src/Lucene.Net.Tests.Expressions/Support/TestApiConsistency.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Expressions/Support/TestApiConsistency.cs b/src/Lucene.Net.Tests.Expressions/Support/TestApiConsistency.cs
index 6399d73..5de8e18 100644
--- a/src/Lucene.Net.Tests.Expressions/Support/TestApiConsistency.cs
+++ b/src/Lucene.Net.Tests.Expressions/Support/TestApiConsistency.cs
@@ -83,12 +83,14 @@ namespace Lucene.Net.Expressions
             base.TestForPropertiesThatReturnArray(typeFromTargetAssembly);
         }
 
+#if !NETSTANDARD
         [Test, LuceneNetSpecific]
         [TestCase(typeof(Lucene.Net.Expressions.Bindings))]
         public override void TestForMethodsThatReturnWritableArray(Type typeFromTargetAssembly)
         {
             base.TestForMethodsThatReturnWritableArray(typeFromTargetAssembly);
         }
+#endif
 
         [Test, LuceneNetSpecific]
         [TestCase(typeof(Lucene.Net.Expressions.Bindings))]

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/fa4f034f/src/Lucene.Net.Tests.Expressions/project.json
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Expressions/project.json b/src/Lucene.Net.Tests.Expressions/project.json
index 1fbfb5c..834fd00 100644
--- a/src/Lucene.Net.Tests.Expressions/project.json
+++ b/src/Lucene.Net.Tests.Expressions/project.json
@@ -19,11 +19,7 @@
       "imports": "dnxcore50",
       "buildOptions": {
         "debugType": "portable",
-        "compile": {
-          "excludeFiles": [
-            "Support/TestApiConsistency.cs"
-          ]
-        }
+        "define": [ "NETSTANDARD" ]
       }
     },
     "net451": {

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/fa4f034f/src/Lucene.Net.Tests.Facet/Support/TestApiConsistency.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Facet/Support/TestApiConsistency.cs b/src/Lucene.Net.Tests.Facet/Support/TestApiConsistency.cs
index 3cc8e2e..97a41da 100644
--- a/src/Lucene.Net.Tests.Facet/Support/TestApiConsistency.cs
+++ b/src/Lucene.Net.Tests.Facet/Support/TestApiConsistency.cs
@@ -87,12 +87,14 @@ namespace Lucene.Net.Tests.Facet
             base.TestForPropertiesThatReturnArray(typeFromTargetAssembly);
         }
 
+#if !NETSTANDARD
         [Test, LuceneNetSpecific]
         [TestCase(typeof(Lucene.Net.Facet.Facets))]
         public override void TestForMethodsThatReturnWritableArray(Type typeFromTargetAssembly)
         {
             base.TestForMethodsThatReturnWritableArray(typeFromTargetAssembly);
         }
+#endif
 
         [Test, LuceneNetSpecific]
         [TestCase(typeof(Lucene.Net.Facet.Facets))]

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/fa4f034f/src/Lucene.Net.Tests.Facet/project.json
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Facet/project.json b/src/Lucene.Net.Tests.Facet/project.json
index 88a2645..ebfa125 100644
--- a/src/Lucene.Net.Tests.Facet/project.json
+++ b/src/Lucene.Net.Tests.Facet/project.json
@@ -19,12 +19,7 @@
       "imports": "dnxcore50",
       "buildOptions": {
         "debugType": "portable",
-        "define": [ "NETSTANDARD" ],
-        "compile": {
-          "excludeFiles": [
-            "Support/TestApiConsistency.cs"
-          ]
-        }
+        "define": [ "NETSTANDARD" ]
       }
     },
     "net451": {

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/fa4f034f/src/Lucene.Net.Tests.Grouping/Support/TestApiConsistency.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Grouping/Support/TestApiConsistency.cs b/src/Lucene.Net.Tests.Grouping/Support/TestApiConsistency.cs
index 6b419b4..ed8db9e 100644
--- a/src/Lucene.Net.Tests.Grouping/Support/TestApiConsistency.cs
+++ b/src/Lucene.Net.Tests.Grouping/Support/TestApiConsistency.cs
@@ -87,12 +87,14 @@ namespace Lucene.Net.Tests.Grouping
             base.TestForPropertiesThatReturnArray(typeFromTargetAssembly);
         }
 
+#if !NETSTANDARD
         [Test, LuceneNetSpecific]
         [TestCase(typeof(Lucene.Net.Search.Grouping.ICollectedSearchGroup))]
         public override void TestForMethodsThatReturnWritableArray(Type typeFromTargetAssembly)
         {
             base.TestForMethodsThatReturnWritableArray(typeFromTargetAssembly);
         }
+#endif
 
         [Test, LuceneNetSpecific]
         [TestCase(typeof(Lucene.Net.Search.Grouping.ICollectedSearchGroup))]

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/fa4f034f/src/Lucene.Net.Tests.Grouping/project.json
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Grouping/project.json b/src/Lucene.Net.Tests.Grouping/project.json
index 1354ce9..fb513f4 100644
--- a/src/Lucene.Net.Tests.Grouping/project.json
+++ b/src/Lucene.Net.Tests.Grouping/project.json
@@ -19,12 +19,7 @@
       "imports": "dnxcore50",
       "buildOptions": {
         "debugType": "portable",
-        "define": [ "NETSTANDARD" ],
-        "compile": {
-          "excludeFiles": [
-            "Support/TestApiConsistency.cs"
-          ]
-        }
+        "define": [ "NETSTANDARD" ]
       }
     },
     "net451": {

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/fa4f034f/src/Lucene.Net.Tests.Highlighter/Support/TestApiConsistency.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Highlighter/Support/TestApiConsistency.cs b/src/Lucene.Net.Tests.Highlighter/Support/TestApiConsistency.cs
index 05622b6..58a1d86 100644
--- a/src/Lucene.Net.Tests.Highlighter/Support/TestApiConsistency.cs
+++ b/src/Lucene.Net.Tests.Highlighter/Support/TestApiConsistency.cs
@@ -87,12 +87,14 @@ namespace Lucene.Net.Search
             base.TestForPropertiesThatReturnArray(typeFromTargetAssembly);
         }
 
+#if !NETSTANDARD
         [Test, LuceneNetSpecific]
         [TestCase(typeof(Lucene.Net.Search.Highlight.DefaultEncoder))]
         public override void TestForMethodsThatReturnWritableArray(Type typeFromTargetAssembly)
         {
             base.TestForMethodsThatReturnWritableArray(typeFromTargetAssembly);
         }
+#endif
 
         [Test, LuceneNetSpecific]
         [TestCase(typeof(Lucene.Net.Search.Highlight.DefaultEncoder))]

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/fa4f034f/src/Lucene.Net.Tests.Highlighter/project.json
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Highlighter/project.json b/src/Lucene.Net.Tests.Highlighter/project.json
index 44720d3..dd33718 100644
--- a/src/Lucene.Net.Tests.Highlighter/project.json
+++ b/src/Lucene.Net.Tests.Highlighter/project.json
@@ -24,12 +24,7 @@
       "imports": "dnxcore50",
       "buildOptions": {
         "debugType": "portable",
-        "define": [ "NETSTANDARD" ],
-        "compile": {
-          "excludeFiles": [
-            "Support/TestApiConsistency.cs"
-          ]
-        }
+        "define": [ "NETSTANDARD" ]
       },
       "dependencies": {
         "System.Xml.XmlDocument": "4.0.1"

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/fa4f034f/src/Lucene.Net.Tests.ICU/Support/TestApiConsistency.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.ICU/Support/TestApiConsistency.cs b/src/Lucene.Net.Tests.ICU/Support/TestApiConsistency.cs
index 3d28be6..53f3b72 100644
--- a/src/Lucene.Net.Tests.ICU/Support/TestApiConsistency.cs
+++ b/src/Lucene.Net.Tests.ICU/Support/TestApiConsistency.cs
@@ -86,12 +86,14 @@ namespace Lucene.Net.Support
             base.TestForPropertiesThatReturnArray(typeFromTargetAssembly);
         }
 
+#if !NETSTANDARD
         [Test, LuceneNetSpecific]
         [TestCase(typeof(Lucene.Net.Support.BreakIterator))]
         public override void TestForMethodsThatReturnWritableArray(Type typeFromTargetAssembly)
         {
             base.TestForMethodsThatReturnWritableArray(typeFromTargetAssembly);
         }
+#endif
 
         [Test, LuceneNetSpecific]
         [TestCase(typeof(Lucene.Net.Support.BreakIterator))]

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/fa4f034f/src/Lucene.Net.Tests.ICU/project.json
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.ICU/project.json b/src/Lucene.Net.Tests.ICU/project.json
index 0dc780d..4dc5c7a 100644
--- a/src/Lucene.Net.Tests.ICU/project.json
+++ b/src/Lucene.Net.Tests.ICU/project.json
@@ -54,9 +54,6 @@
             "../Lucene.Net.Tests.Highlighter/PostingsHighlight/TestPostingsHighlighterRanking.cs",
             "../Lucene.Net.Tests.Highlighter/PostingsHighlight/TestWholeBreakIterator.cs",
             "../Lucene.Net.Tests.Highlighter/VectorHighlight/BreakIteratorBoundaryScannerTest.cs"
-          ],
-          "excludeFiles": [
-            "Support/TestApiConsistency.cs"
           ]
         }
       },

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/fa4f034f/src/Lucene.Net.Tests.Join/Support/TestApiConsistency.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Join/Support/TestApiConsistency.cs b/src/Lucene.Net.Tests.Join/Support/TestApiConsistency.cs
index 629b745..631221c 100644
--- a/src/Lucene.Net.Tests.Join/Support/TestApiConsistency.cs
+++ b/src/Lucene.Net.Tests.Join/Support/TestApiConsistency.cs
@@ -87,12 +87,14 @@ namespace Lucene.Net.Join
             base.TestForPropertiesThatReturnArray(typeFromTargetAssembly);
         }
 
+#if !NETSTANDARD
         [Test, LuceneNetSpecific]
         [TestCase(typeof(Lucene.Net.Join.FakeScorer))]
         public override void TestForMethodsThatReturnWritableArray(Type typeFromTargetAssembly)
         {
             base.TestForMethodsThatReturnWritableArray(typeFromTargetAssembly);
         }
+#endif
 
         [Test, LuceneNetSpecific]
         [TestCase(typeof(Lucene.Net.Join.FakeScorer))]

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/fa4f034f/src/Lucene.Net.Tests.Join/project.json
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Join/project.json b/src/Lucene.Net.Tests.Join/project.json
index 65a4484..651cf9a 100644
--- a/src/Lucene.Net.Tests.Join/project.json
+++ b/src/Lucene.Net.Tests.Join/project.json
@@ -19,11 +19,7 @@
       "imports": "dnxcore50",
       "buildOptions": {
         "debugType": "portable",
-        "compile": {
-          "excludeFiles": [
-            "Support/TestApiConsistency.cs"
-          ]
-        }
+        "define": [ "NETSTANDARD" ]
       }
     },
     "net451": {

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/fa4f034f/src/Lucene.Net.Tests.Memory/Support/TestApiConsistency.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Memory/Support/TestApiConsistency.cs b/src/Lucene.Net.Tests.Memory/Support/TestApiConsistency.cs
index 192dec5..d9e703b 100644
--- a/src/Lucene.Net.Tests.Memory/Support/TestApiConsistency.cs
+++ b/src/Lucene.Net.Tests.Memory/Support/TestApiConsistency.cs
@@ -87,12 +87,14 @@ namespace Lucene.Net.Tests.Memory
             base.TestForPropertiesThatReturnArray(typeFromTargetAssembly);
         }
 
+#if !NETSTANDARD
         [Test, LuceneNetSpecific]
         [TestCase(typeof(Lucene.Net.Index.Memory.MemoryIndex))]
         public override void TestForMethodsThatReturnWritableArray(Type typeFromTargetAssembly)
         {
             base.TestForMethodsThatReturnWritableArray(typeFromTargetAssembly);
         }
+#endif
 
         [Test, LuceneNetSpecific]
         [TestCase(typeof(Lucene.Net.Index.Memory.MemoryIndex))]

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/fa4f034f/src/Lucene.Net.Tests.Memory/project.json
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Memory/project.json b/src/Lucene.Net.Tests.Memory/project.json
index be62899..6d0182f 100644
--- a/src/Lucene.Net.Tests.Memory/project.json
+++ b/src/Lucene.Net.Tests.Memory/project.json
@@ -25,11 +25,7 @@
       "imports": "dnxcore50",
       "buildOptions": {
         "debugType": "portable",
-        "compile": {
-          "excludeFiles": [
-            "Support/TestApiConsistency.cs"
-          ]
-        }
+        "define": [ "NETSTANDARD" ]
       }
     },
     "net451": {

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/fa4f034f/src/Lucene.Net.Tests.Misc/Support/TestApiConsistency.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Misc/Support/TestApiConsistency.cs b/src/Lucene.Net.Tests.Misc/Support/TestApiConsistency.cs
index 8d27dd3..0417c4c 100644
--- a/src/Lucene.Net.Tests.Misc/Support/TestApiConsistency.cs
+++ b/src/Lucene.Net.Tests.Misc/Support/TestApiConsistency.cs
@@ -87,12 +87,14 @@ namespace Lucene.Net.Tests.Misc
             base.TestForPropertiesThatReturnArray(typeFromTargetAssembly);
         }
 
+#if !NETSTANDARD
         [Test, LuceneNetSpecific]
         [TestCase(typeof(Lucene.Net.Misc.SweetSpotSimilarity))]
         public override void TestForMethodsThatReturnWritableArray(Type typeFromTargetAssembly)
         {
             base.TestForMethodsThatReturnWritableArray(typeFromTargetAssembly);
         }
+#endif
 
         [Test, LuceneNetSpecific]
         [TestCase(typeof(Lucene.Net.Misc.SweetSpotSimilarity))]

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/fa4f034f/src/Lucene.Net.Tests.Misc/project.json
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Misc/project.json b/src/Lucene.Net.Tests.Misc/project.json
index 9737338..9cfd805 100644
--- a/src/Lucene.Net.Tests.Misc/project.json
+++ b/src/Lucene.Net.Tests.Misc/project.json
@@ -18,11 +18,7 @@
       "imports": "dnxcore50",
       "buildOptions": {
         "debugType": "portable",
-        "compile": {
-          "excludeFiles": [
-            "Support/TestApiConsistency.cs"
-          ]
-        }
+        "define": [ "NETSTANDARD" ]
       }
     },
     "net451": {

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/fa4f034f/src/Lucene.Net.Tests.Queries/Support/TestApiConsistency.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Queries/Support/TestApiConsistency.cs b/src/Lucene.Net.Tests.Queries/Support/TestApiConsistency.cs
index 1a26d7d..3d8b987 100644
--- a/src/Lucene.Net.Tests.Queries/Support/TestApiConsistency.cs
+++ b/src/Lucene.Net.Tests.Queries/Support/TestApiConsistency.cs
@@ -87,12 +87,14 @@ namespace Lucene.Net.Tests.Queries
             base.TestForPropertiesThatReturnArray(typeFromTargetAssembly);
         }
 
+#if !NETSTANDARD
         [Test, LuceneNetSpecific]
         [TestCase(typeof(Lucene.Net.Queries.BooleanFilter))]
         public override void TestForMethodsThatReturnWritableArray(Type typeFromTargetAssembly)
         {
             base.TestForMethodsThatReturnWritableArray(typeFromTargetAssembly);
         }
+#endif
 
         [Test, LuceneNetSpecific]
         [TestCase(typeof(Lucene.Net.Queries.BooleanFilter))]

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/fa4f034f/src/Lucene.Net.Tests.Queries/project.json
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Queries/project.json b/src/Lucene.Net.Tests.Queries/project.json
index 5de2e88..b669726 100644
--- a/src/Lucene.Net.Tests.Queries/project.json
+++ b/src/Lucene.Net.Tests.Queries/project.json
@@ -18,11 +18,7 @@
       "imports": "dnxcore50",
       "buildOptions": {
         "debugType": "portable",
-        "compile": {
-          "excludeFiles": [
-            "Support/TestApiConsistency.cs"
-          ]
-        }
+        "define": [ "NETSTANDARD" ]
       }
     },
     "net451": {

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/fa4f034f/src/Lucene.Net.Tests.QueryParser/Support/TestApiConsistency.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.QueryParser/Support/TestApiConsistency.cs b/src/Lucene.Net.Tests.QueryParser/Support/TestApiConsistency.cs
index a9a941e..175c0df 100644
--- a/src/Lucene.Net.Tests.QueryParser/Support/TestApiConsistency.cs
+++ b/src/Lucene.Net.Tests.QueryParser/Support/TestApiConsistency.cs
@@ -87,12 +87,14 @@ namespace Lucene.Net.QueryParsers
             base.TestForPropertiesThatReturnArray(typeFromTargetAssembly);
         }
 
+#if !NETSTANDARD
         [Test, LuceneNetSpecific]
         [TestCase(typeof(Lucene.Net.QueryParsers.Classic.ICharStream))]
         public override void TestForMethodsThatReturnWritableArray(Type typeFromTargetAssembly)
         {
             base.TestForMethodsThatReturnWritableArray(typeFromTargetAssembly);
         }
+#endif
 
         [Test, LuceneNetSpecific]
         [TestCase(typeof(Lucene.Net.QueryParsers.Classic.ICharStream))]

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/fa4f034f/src/Lucene.Net.Tests.QueryParser/project.json
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.QueryParser/project.json b/src/Lucene.Net.Tests.QueryParser/project.json
index afb802d..25ebc86 100644
--- a/src/Lucene.Net.Tests.QueryParser/project.json
+++ b/src/Lucene.Net.Tests.QueryParser/project.json
@@ -51,8 +51,7 @@
         "define": [ "NETSTANDARD" ],
         "compile": {
           "excludeFiles": [
-            "Xml/TestQueryTemplateManager.cs",
-            "Support/TestApiConsistency.cs"
+            "Xml/TestQueryTemplateManager.cs"
           ]
         }
       }

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/fa4f034f/src/Lucene.Net.Tests.Sandbox/Support/TestApiConsistency.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Sandbox/Support/TestApiConsistency.cs b/src/Lucene.Net.Tests.Sandbox/Support/TestApiConsistency.cs
index 3d3c52f..c6f7c3d 100644
--- a/src/Lucene.Net.Tests.Sandbox/Support/TestApiConsistency.cs
+++ b/src/Lucene.Net.Tests.Sandbox/Support/TestApiConsistency.cs
@@ -87,12 +87,14 @@ namespace Lucene.Net.Sandbox
             base.TestForPropertiesThatReturnArray(typeFromTargetAssembly);
         }
 
+#if !NETSTANDARD
         [Test, LuceneNetSpecific]
         [TestCase(typeof(Lucene.Net.Sandbox.Queries.DuplicateFilter))]
         public override void TestForMethodsThatReturnWritableArray(Type typeFromTargetAssembly)
         {
             base.TestForMethodsThatReturnWritableArray(typeFromTargetAssembly);
         }
+#endif
 
         [Test, LuceneNetSpecific]
         [TestCase(typeof(Lucene.Net.Sandbox.Queries.DuplicateFilter))]

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/fa4f034f/src/Lucene.Net.Tests.Sandbox/project.json
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Sandbox/project.json b/src/Lucene.Net.Tests.Sandbox/project.json
index 5b56757..8b8156e 100644
--- a/src/Lucene.Net.Tests.Sandbox/project.json
+++ b/src/Lucene.Net.Tests.Sandbox/project.json
@@ -24,11 +24,7 @@
       "imports": "dnxcore50",
       "buildOptions": {
         "debugType": "portable",
-        "compile": {
-          "excludeFiles": [
-            "Support/TestApiConsistency.cs"
-          ]
-        }
+        "define": [ "NETSTANDARD" ]
       }
     },
     "net451": {

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/fa4f034f/src/Lucene.Net.Tests.Spatial/Support/TestApiConsistency.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Spatial/Support/TestApiConsistency.cs b/src/Lucene.Net.Tests.Spatial/Support/TestApiConsistency.cs
index b7b98ad..8780592 100644
--- a/src/Lucene.Net.Tests.Spatial/Support/TestApiConsistency.cs
+++ b/src/Lucene.Net.Tests.Spatial/Support/TestApiConsistency.cs
@@ -87,12 +87,14 @@ namespace Lucene.Net.Tests.Spatial
             base.TestForPropertiesThatReturnArray(typeFromTargetAssembly);
         }
 
+#if !NETSTANDARD
         [Test, LuceneNetSpecific]
         [TestCase(typeof(Lucene.Net.Spatial.DisjointSpatialFilter))]
         public override void TestForMethodsThatReturnWritableArray(Type typeFromTargetAssembly)
         {
             base.TestForMethodsThatReturnWritableArray(typeFromTargetAssembly);
         }
+#endif
 
         [Test, LuceneNetSpecific]
         [TestCase(typeof(Lucene.Net.Spatial.DisjointSpatialFilter))]

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/fa4f034f/src/Lucene.Net.Tests.Spatial/project.json
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Spatial/project.json b/src/Lucene.Net.Tests.Spatial/project.json
index 69963f5..a29f7f5 100644
--- a/src/Lucene.Net.Tests.Spatial/project.json
+++ b/src/Lucene.Net.Tests.Spatial/project.json
@@ -36,12 +36,7 @@
       "imports": [ "dnxcore50", "portable-net403+sl5+win8+wp8+wpa81" ],
       "buildOptions": {
         "debugType": "portable",
-        "define": [ "NETSTANDARD" ],
-        "compile": {
-          "excludeFiles": [
-            "Support/TestApiConsistency.cs"
-          ]
-        }
+        "define": [ "NETSTANDARD" ]
       }
     },
     "net451": {

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/fa4f034f/src/Lucene.Net.Tests.Suggest/Support/TestApiConsistency.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Suggest/Support/TestApiConsistency.cs b/src/Lucene.Net.Tests.Suggest/Support/TestApiConsistency.cs
index 2d9772f..cb7d22a 100644
--- a/src/Lucene.Net.Tests.Suggest/Support/TestApiConsistency.cs
+++ b/src/Lucene.Net.Tests.Suggest/Support/TestApiConsistency.cs
@@ -87,12 +87,14 @@ namespace Lucene.Net.Tests.Suggest
             base.TestForPropertiesThatReturnArray(typeFromTargetAssembly);
         }
 
+#if !NETSTANDARD
         [Test, LuceneNetSpecific]
         [TestCase(typeof(Lucene.Net.Search.Suggest.IInputIterator))]
         public override void TestForMethodsThatReturnWritableArray(Type typeFromTargetAssembly)
         {
             base.TestForMethodsThatReturnWritableArray(typeFromTargetAssembly);
         }
+#endif
 
         [Test, LuceneNetSpecific]
         [TestCase(typeof(Lucene.Net.Search.Suggest.IInputIterator))]

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/fa4f034f/src/Lucene.Net.Tests.Suggest/project.json
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Suggest/project.json b/src/Lucene.Net.Tests.Suggest/project.json
index 98e8c2b..58e7d24 100644
--- a/src/Lucene.Net.Tests.Suggest/project.json
+++ b/src/Lucene.Net.Tests.Suggest/project.json
@@ -25,12 +25,7 @@
       "imports": "dnxcore50",
       "buildOptions": {
         "debugType": "portable",
-        "define": [ "NETSTANDARD" ],
-        "compile": {
-          "excludeFiles": [
-            "Support/TestApiConsistency.cs"
-          ]
-        }
+        "define": [ "NETSTANDARD" ]
       }
     },
     "net451": {

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/fa4f034f/src/Lucene.Net.Tests/Support/TestApiConsistency.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/Support/TestApiConsistency.cs b/src/Lucene.Net.Tests/Support/TestApiConsistency.cs
index c662c07..9a226ab 100644
--- a/src/Lucene.Net.Tests/Support/TestApiConsistency.cs
+++ b/src/Lucene.Net.Tests/Support/TestApiConsistency.cs
@@ -87,12 +87,14 @@ namespace Lucene.Net
             base.TestForPropertiesThatReturnArray(typeFromTargetAssembly);
         }
 
+#if !NETSTANDARD
         [Test, LuceneNetSpecific]
         [TestCase(typeof(Lucene.Net.Analysis.Analyzer))]
         public override void TestForMethodsThatReturnWritableArray(Type typeFromTargetAssembly)
         {
             base.TestForMethodsThatReturnWritableArray(typeFromTargetAssembly);
         }
+#endif
 
         [Test, LuceneNetSpecific]
         [TestCase(typeof(Lucene.Net.Analysis.Analyzer))]

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/fa4f034f/src/Lucene.Net.Tests/project.json
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/project.json b/src/Lucene.Net.Tests/project.json
index b1cf1a4..117862c 100644
--- a/src/Lucene.Net.Tests/project.json
+++ b/src/Lucene.Net.Tests/project.json
@@ -72,7 +72,6 @@
         "compile": {
           "exclude": [ "Util/JunitCompat" ],
           "excludeFiles": [
-            "Support/TestApiConsistency.cs",
             "Support/TestCase.cs",
             "Util/TestMaxFailuresRule.cs"
           ]


[02/22] lucenenet git commit: Added lucene-cli + tests - a wrapper console application so we can run the various utilities and demos in .NET on the command line.

Posted by ni...@apache.org.
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/9e389540/src/tools/lucene-cli/arguments/IndexDirectoryArgument.cs
----------------------------------------------------------------------
diff --git a/src/tools/lucene-cli/arguments/IndexDirectoryArgument.cs b/src/tools/lucene-cli/arguments/IndexDirectoryArgument.cs
new file mode 100644
index 0000000..be54e71
--- /dev/null
+++ b/src/tools/lucene-cli/arguments/IndexDirectoryArgument.cs
@@ -0,0 +1,57 @@
+using Lucene.Net.Cli.CommandLine;
+
+namespace Lucene.Net.Cli
+{
+    /*
+     * Licensed to the Apache Software Foundation (ASF) under one or more
+     * contributor license agreements.  See the NOTICE file distributed with
+     * this work for additional information regarding copyright ownership.
+     * The ASF licenses this file to You under the Apache License, Version 2.0
+     * (the "License"); you may not use this file except in compliance with
+     * the License.  You may obtain a copy of the License at
+     *
+     *     http://www.apache.org/licenses/LICENSE-2.0
+     *
+     * Unless required by applicable law or agreed to in writing, software
+     * distributed under the License is distributed on an "AS IS" BASIS,
+     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     * See the License for the specific language governing permissions and
+     * limitations under the License.
+     */
+
+    public class IndexDirectoryArgument : CommandArgument
+    {
+        private readonly bool required;
+
+        public IndexDirectoryArgument(bool required = false)
+        {
+            this.required = required;
+
+            if (required)
+            {
+                Name = "<INDEX_DIRECTORY>";
+                Description = Resources.Strings.IndexDirectoryArgumentDescription;
+            }
+            else
+            {
+                Name = "[<INDEX_DIRECTORY>]";
+                Description = Resources.Strings.IndexDirectoryArgumentDescription + " " + Resources.Strings.IndexDirectoryOptionalArgumentDescription;
+            }
+        }
+
+        public override string Value
+        {
+            get
+            {
+                if (required)
+                {
+                    return base.Value;
+                }
+                // Return current directory if index directory not supplied.
+                return string.IsNullOrWhiteSpace(base.Value) ?
+                    System.IO.Directory.GetCurrentDirectory() :
+                    base.Value;
+            }
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/9e389540/src/tools/lucene-cli/arguments/SegmentsArgument.cs
----------------------------------------------------------------------
diff --git a/src/tools/lucene-cli/arguments/SegmentsArgument.cs b/src/tools/lucene-cli/arguments/SegmentsArgument.cs
new file mode 100644
index 0000000..bf6b0c9
--- /dev/null
+++ b/src/tools/lucene-cli/arguments/SegmentsArgument.cs
@@ -0,0 +1,31 @@
+using Lucene.Net.Cli.CommandLine;
+
+namespace Lucene.Net.Cli
+{
+    /*
+     * Licensed to the Apache Software Foundation (ASF) under one or more
+     * contributor license agreements.  See the NOTICE file distributed with
+     * this work for additional information regarding copyright ownership.
+     * The ASF licenses this file to You under the Apache License, Version 2.0
+     * (the "License"); you may not use this file except in compliance with
+     * the License.  You may obtain a copy of the License at
+     *
+     *     http://www.apache.org/licenses/LICENSE-2.0
+     *
+     * Unless required by applicable law or agreed to in writing, software
+     * distributed under the License is distributed on an "AS IS" BASIS,
+     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     * See the License for the specific language governing permissions and
+     * limitations under the License.
+     */
+
+    public class SegmentsArgument : CommandArgument
+    {
+        public SegmentsArgument()
+        {
+            Name = "<SEGMENT>[ [<SEGMENT_2] ...[<SEGMENT_N>]]";
+            Description = Resources.Strings.SegmentsArgumentDescription;
+            MultipleValues = true;
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/9e389540/src/tools/lucene-cli/commands/RootCommand.cs
----------------------------------------------------------------------
diff --git a/src/tools/lucene-cli/commands/RootCommand.cs b/src/tools/lucene-cli/commands/RootCommand.cs
new file mode 100644
index 0000000..c0d0b93
--- /dev/null
+++ b/src/tools/lucene-cli/commands/RootCommand.cs
@@ -0,0 +1,46 @@
+namespace Lucene.Net.Cli
+{
+    /*
+     * Licensed to the Apache Software Foundation (ASF) under one or more
+     * contributor license agreements.  See the NOTICE file distributed with
+     * this work for additional information regarding copyright ownership.
+     * The ASF licenses this file to You under the Apache License, Version 2.0
+     * (the "License"); you may not use this file except in compliance with
+     * the License.  You may obtain a copy of the License at
+     *
+     *     http://www.apache.org/licenses/LICENSE-2.0
+     *
+     * Unless required by applicable law or agreed to in writing, software
+     * distributed under the License is distributed on an "AS IS" BASIS,
+     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     * See the License for the specific language governing permissions and
+     * limitations under the License.
+     */
+
+    public class RootCommand : ICommand
+    {
+        public class Configuration : ConfigurationBase
+        {
+            public Configuration(CommandLineOptions options)
+            {
+                this.Description = FromResource("RootCommandDescription");
+
+                //// LUCENENET TODO: Fix this to use CommandLine stuff...
+                //this.VersionOption("-v|--version", typeof(Program).GetTypeInfo().Assembly.GetCustomAttribute<AssemblyInformationalVersionAttribute>().InformationalVersion);
+
+                this.Commands.Add(new AnalysisCommand.Configuration(options));
+                this.Commands.Add(new IndexCommand.Configuration(options));
+                this.Commands.Add(new LockCommand.Configuration(options));
+                this.Commands.Add(new DemoCommand.Configuration(options));
+
+                this.OnExecute(() => new RootCommand().Run(this));
+            }
+        }
+
+        public int Run(ConfigurationBase cmd)
+        {
+            cmd.ShowHelp();
+            return 1;
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/9e389540/src/tools/lucene-cli/commands/analysis/AnalysisCommand.cs
----------------------------------------------------------------------
diff --git a/src/tools/lucene-cli/commands/analysis/AnalysisCommand.cs b/src/tools/lucene-cli/commands/analysis/AnalysisCommand.cs
new file mode 100644
index 0000000..969bd58
--- /dev/null
+++ b/src/tools/lucene-cli/commands/analysis/AnalysisCommand.cs
@@ -0,0 +1,45 @@
+namespace Lucene.Net.Cli
+{
+    /*
+     * Licensed to the Apache Software Foundation (ASF) under one or more
+     * contributor license agreements.  See the NOTICE file distributed with
+     * this work for additional information regarding copyright ownership.
+     * The ASF licenses this file to You under the Apache License, Version 2.0
+     * (the "License"); you may not use this file except in compliance with
+     * the License.  You may obtain a copy of the License at
+     *
+     *     http://www.apache.org/licenses/LICENSE-2.0
+     *
+     * Unless required by applicable law or agreed to in writing, software
+     * distributed under the License is distributed on an "AS IS" BASIS,
+     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     * See the License for the specific language governing permissions and
+     * limitations under the License.
+     */
+
+    public class AnalysisCommand : ICommand
+    {
+        public class Configuration : ConfigurationBase
+        {
+            public Configuration(CommandLineOptions options)
+            {
+                this.Name = "analysis";
+                this.Description = FromResource("Description");
+
+                //this.Commands.Add(new AnalysisICUBuildRBBIRulesCommand.Configuration(options));
+                //this.Commands.Add(new AnalysisKuromojiBuildDictionaryCommand.Configuration(options));
+                this.Commands.Add(new AnalysisStempelCompileStemsCommand.Configuration(options));
+                this.Commands.Add(new AnalysisStempelPatchStemsCommand.Configuration(options));
+
+
+                this.OnExecute(() => new AnalysisCommand().Run(this));
+            }
+        }
+
+        public int Run(ConfigurationBase cmd)
+        {
+            cmd.ShowHelp();
+            return 1;
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/9e389540/src/tools/lucene-cli/commands/analysis/analysis-stempel-compile-stems/AnalysisStempelCompileStemsCommand.cs
----------------------------------------------------------------------
diff --git a/src/tools/lucene-cli/commands/analysis/analysis-stempel-compile-stems/AnalysisStempelCompileStemsCommand.cs b/src/tools/lucene-cli/commands/analysis/analysis-stempel-compile-stems/AnalysisStempelCompileStemsCommand.cs
new file mode 100644
index 0000000..2528813
--- /dev/null
+++ b/src/tools/lucene-cli/commands/analysis/analysis-stempel-compile-stems/AnalysisStempelCompileStemsCommand.cs
@@ -0,0 +1,77 @@
+using Egothor.Stemmer;
+using Lucene.Net.Cli.CommandLine;
+using System.Collections.Generic;
+
+namespace Lucene.Net.Cli
+{
+    /*
+     * Licensed to the Apache Software Foundation (ASF) under one or more
+     * contributor license agreements.  See the NOTICE file distributed with
+     * this work for additional information regarding copyright ownership.
+     * The ASF licenses this file to You under the Apache License, Version 2.0
+     * (the "License"); you may not use this file except in compliance with
+     * the License.  You may obtain a copy of the License at
+     *
+     *     http://www.apache.org/licenses/LICENSE-2.0
+     *
+     * Unless required by applicable law or agreed to in writing, software
+     * distributed under the License is distributed on an "AS IS" BASIS,
+     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     * See the License for the specific language governing permissions and
+     * limitations under the License.
+     */
+
+    public class AnalysisStempelCompileStemsCommand : ICommand
+    {
+        public class Configuration : ConfigurationBase
+        {
+            public Configuration(CommandLineOptions options)
+            {
+                this.Main = (args) => Compile.Main(args);
+
+                this.Name = "stempel-compile-stems";
+                this.Description = FromResource("Description");
+
+                this.StemmingAlgorithm = this.Argument(
+                    "<STEMMING_ALGORITHM>",
+                    FromResource("StemmingAlgorithmDescription"));
+                this.StemmerTableFiles = this.Argument(
+                    "<STEMMER_TABLE_FILE>[ <STEMMER_TABLE_FILE_2>...]",
+                    FromResource("StemmerTableFilesDescription"),
+                    multipleValues: true);
+                this.StemmerTableFilesEncoding = this.Option(
+                    "-e|--encoding <ENCODING>",
+                    FromResource("StemmerTableFilesEncodingDescription"),
+                    CommandOptionType.SingleValue);
+
+                this.OnExecute(() => new AnalysisStempelCompileStemsCommand().Run(this));
+            }
+
+            public virtual CommandArgument StemmingAlgorithm { get; private set; }
+            public virtual CommandArgument StemmerTableFiles { get; private set; }
+            public virtual CommandOption StemmerTableFilesEncoding { get; private set; }
+        }
+
+        public int Run(ConfigurationBase cmd)
+        {
+            if (!cmd.ValidateArguments(2))
+            {
+                return 1;
+            }
+
+            var input = cmd as Configuration;
+            var args = new List<string>() { input.StemmingAlgorithm.Value };
+
+            args.AddRange(input.StemmerTableFiles.Values);
+
+            if (input.StemmerTableFilesEncoding.HasValue())
+            {
+                args.Add("--encoding");
+                args.Add(input.StemmerTableFilesEncoding.Value());
+            }
+
+            cmd.Main(args.ToArray());
+            return 0;
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/9e389540/src/tools/lucene-cli/commands/analysis/analysis-stempel-patch-stems/AnalysisStempelPatchStemsCommand.cs
----------------------------------------------------------------------
diff --git a/src/tools/lucene-cli/commands/analysis/analysis-stempel-patch-stems/AnalysisStempelPatchStemsCommand.cs b/src/tools/lucene-cli/commands/analysis/analysis-stempel-patch-stems/AnalysisStempelPatchStemsCommand.cs
new file mode 100644
index 0000000..4e24118
--- /dev/null
+++ b/src/tools/lucene-cli/commands/analysis/analysis-stempel-patch-stems/AnalysisStempelPatchStemsCommand.cs
@@ -0,0 +1,70 @@
+using Egothor.Stemmer;
+using Lucene.Net.Cli.CommandLine;
+using System.Collections.Generic;
+
+namespace Lucene.Net.Cli
+{
+    /*
+     * Licensed to the Apache Software Foundation (ASF) under one or more
+     * contributor license agreements.  See the NOTICE file distributed with
+     * this work for additional information regarding copyright ownership.
+     * The ASF licenses this file to You under the Apache License, Version 2.0
+     * (the "License"); you may not use this file except in compliance with
+     * the License.  You may obtain a copy of the License at
+     *
+     *     http://www.apache.org/licenses/LICENSE-2.0
+     *
+     * Unless required by applicable law or agreed to in writing, software
+     * distributed under the License is distributed on an "AS IS" BASIS,
+     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     * See the License for the specific language governing permissions and
+     * limitations under the License.
+     */
+
+    public class AnalysisStempelPatchStemsCommand : ICommand
+    {
+        public class Configuration : ConfigurationBase
+        {
+            public Configuration(CommandLineOptions options)
+            {
+                this.Main = (args) => DiffIt.Main(args);
+
+                this.Name = "stempel-patch-stems";
+                this.Description = FromResource("Description");
+
+                this.StemmerTableFiles = this.Argument(
+                    "<STEMMER_TABLE_FILE>[ <STEMMER_TABLE_FILE_2>...]",
+                    FromResource("StemmerTableFilesDescription"),
+                    multipleValues: true);
+                this.StemmerTableFilesEncoding = this.Option(
+                    "-e|--encoding <ENCODING>",
+                    FromResource("StemmerTableFilesEncodingDescription"),
+                    CommandOptionType.SingleValue);
+
+                this.OnExecute(() => new IndexListHighFreqTermsCommand().Run(this));
+            }
+
+            public virtual CommandArgument StemmerTableFiles { get; private set; }
+            public virtual CommandOption StemmerTableFilesEncoding { get; private set; }
+        }
+
+        public int Run(ConfigurationBase cmd)
+        {
+            if (!cmd.ValidateArguments(1))
+            {
+                return 1;
+            }
+
+            var input = cmd as Configuration;
+            var args = new List<string>(input.StemmerTableFiles.Values);
+
+            if (input.StemmerTableFilesEncoding.HasValue())
+            {
+                args.AddRange(input.StemmerTableFilesEncoding.Values);
+            }
+
+            cmd.Main(args.ToArray());
+            return 0;
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/9e389540/src/tools/lucene-cli/commands/demo/DemoCommand.cs
----------------------------------------------------------------------
diff --git a/src/tools/lucene-cli/commands/demo/DemoCommand.cs b/src/tools/lucene-cli/commands/demo/DemoCommand.cs
new file mode 100644
index 0000000..8ab8536
--- /dev/null
+++ b/src/tools/lucene-cli/commands/demo/DemoCommand.cs
@@ -0,0 +1,49 @@
+namespace Lucene.Net.Cli
+{
+    /*
+     * Licensed to the Apache Software Foundation (ASF) under one or more
+     * contributor license agreements.  See the NOTICE file distributed with
+     * this work for additional information regarding copyright ownership.
+     * The ASF licenses this file to You under the Apache License, Version 2.0
+     * (the "License"); you may not use this file except in compliance with
+     * the License.  You may obtain a copy of the License at
+     *
+     *     http://www.apache.org/licenses/LICENSE-2.0
+     *
+     * Unless required by applicable law or agreed to in writing, software
+     * distributed under the License is distributed on an "AS IS" BASIS,
+     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     * See the License for the specific language governing permissions and
+     * limitations under the License.
+     */
+
+    public class DemoCommand : ICommand
+    {
+        public class Configuration : ConfigurationBase
+        {
+            public Configuration(CommandLineOptions options)
+            {
+                this.Name = "demo";
+                this.Description = FromResource("Description");
+
+                this.Commands.Add(new DemoAssociationsFacetsCommand.Configuration(options));
+                this.Commands.Add(new DemoDistanceFacetsCommand.Configuration(options));
+                this.Commands.Add(new DemoExpressionAggregationFacetsCommand.Configuration(options));
+                this.Commands.Add(new DemoIndexFilesCommand.Configuration(options));
+                this.Commands.Add(new DemoMultiCategoryListsFacetsCommand.Configuration(options));
+                this.Commands.Add(new DemoRangeFacetsCommand.Configuration(options));
+                this.Commands.Add(new DemoSearchFilesCommand.Configuration(options));
+                this.Commands.Add(new DemoSimpleFacetsCommand.Configuration(options));
+                this.Commands.Add(new DemoSimpleSortedSetFacetsCommand.Configuration(options));
+
+                this.OnExecute(() => new DemoCommand().Run(this));
+            }
+        }
+
+        public int Run(ConfigurationBase cmd)
+        {
+            cmd.ShowHelp();
+            return 1;
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/9e389540/src/tools/lucene-cli/commands/demo/DemoConfiguration.cs
----------------------------------------------------------------------
diff --git a/src/tools/lucene-cli/commands/demo/DemoConfiguration.cs b/src/tools/lucene-cli/commands/demo/DemoConfiguration.cs
new file mode 100644
index 0000000..d1f4eda
--- /dev/null
+++ b/src/tools/lucene-cli/commands/demo/DemoConfiguration.cs
@@ -0,0 +1,90 @@
+using Lucene.Net.Cli.CommandLine;
+using Lucene.Net.Cli.SourceCode;
+using System;
+using System.Collections.Generic;
+
+namespace Lucene.Net.Cli
+{
+    /*
+     * Licensed to the Apache Software Foundation (ASF) under one or more
+     * contributor license agreements.  See the NOTICE file distributed with
+     * this work for additional information regarding copyright ownership.
+     * The ASF licenses this file to You under the Apache License, Version 2.0
+     * (the "License"); you may not use this file except in compliance with
+     * the License.  You may obtain a copy of the License at
+     *
+     *     http://www.apache.org/licenses/LICENSE-2.0
+     *
+     * Unless required by applicable law or agreed to in writing, software
+     * distributed under the License is distributed on an "AS IS" BASIS,
+     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     * See the License for the specific language governing permissions and
+     * limitations under the License.
+     */
+
+    public abstract class DemoConfiguration : ConfigurationBase
+    {
+        private static readonly SourceCodeExporter sourceCodeExporter = new SourceCodeExporter();
+        protected readonly CommandOption viewSourceOption;
+        protected readonly CommandOption outputSourceOption;
+
+        protected DemoConfiguration()
+        {
+            this.viewSourceOption = this.Option(
+                "-src|--view-source-code",
+                Resources.Strings.ViewSourceCodeDescription,
+                CommandOptionType.NoValue);
+            this.outputSourceOption = this.Option(
+                "-out|--output-source-code <DIRECTORY>",
+                Resources.Strings.OutputSourceCodeDescription,
+                CommandOptionType.SingleValue);
+
+            this.viewSourceOption.ShowInHelpText = false;
+            this.outputSourceOption.ShowInHelpText = false;
+        }
+
+        public abstract IEnumerable<string> SourceCodeFiles { get; }
+
+        public override void OnExecute(Func<int> invoke)
+        {
+            base.OnExecute(() =>
+            {
+                bool viewSource = viewSourceOption.HasValue();
+                bool outputSource = outputSourceOption.HasValue();
+
+                if (viewSource || outputSource)
+                {
+                    if (outputSource)
+                    {
+                        Out.WriteLine(Resources.Strings.ExportingSourceCodeMessage);
+
+                        string outputPath = outputSourceOption.Value();
+                        sourceCodeExporter.ExportSourceCodeFiles(this.SourceCodeFiles, outputPath);
+
+                        Out.WriteLine(string.Format(Resources.Strings.ExportingSourceCodeCompleteMessage, outputPath));
+                    }
+                    if (viewSource)
+                    {
+                        using (var console = new ConsolePager(this.SourceCodeFiles))
+                        {
+                            console.Run();
+                        }
+                    }
+
+                    return 0;
+                }
+
+                var result = invoke();
+                ShowOutputSourceCodeMessage();
+                return result;
+            });
+        }
+
+        public virtual void ShowOutputSourceCodeMessage()
+        {
+            this.Out.WriteLine();
+            this.Out.WriteLine("-------------------------");
+            this.Out.WriteLine(Resources.Strings.OutputSourceCodeMessage, this.Name);
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/9e389540/src/tools/lucene-cli/commands/demo/demo-associations-facets/DemoAssociationsFacetsCommand.cs
----------------------------------------------------------------------
diff --git a/src/tools/lucene-cli/commands/demo/demo-associations-facets/DemoAssociationsFacetsCommand.cs b/src/tools/lucene-cli/commands/demo/demo-associations-facets/DemoAssociationsFacetsCommand.cs
new file mode 100644
index 0000000..f160f97
--- /dev/null
+++ b/src/tools/lucene-cli/commands/demo/demo-associations-facets/DemoAssociationsFacetsCommand.cs
@@ -0,0 +1,53 @@
+using Lucene.Net.Demo.Facet;
+using System.Collections.Generic;
+
+namespace Lucene.Net.Cli
+{
+    /*
+     * Licensed to the Apache Software Foundation (ASF) under one or more
+     * contributor license agreements.  See the NOTICE file distributed with
+     * this work for additional information regarding copyright ownership.
+     * The ASF licenses this file to You under the Apache License, Version 2.0
+     * (the "License"); you may not use this file except in compliance with
+     * the License.  You may obtain a copy of the License at
+     *
+     *     http://www.apache.org/licenses/LICENSE-2.0
+     *
+     * Unless required by applicable law or agreed to in writing, software
+     * distributed under the License is distributed on an "AS IS" BASIS,
+     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     * See the License for the specific language governing permissions and
+     * limitations under the License.
+     */
+
+    public class DemoAssociationsFacetsCommand : ICommand
+    {
+        public class Configuration : DemoConfiguration
+        {
+            public Configuration(CommandLineOptions options)
+            {
+                this.Main = (args) => AssociationsFacetsExample.Main(args);
+
+                this.Name = "associations-facets";
+                this.Description = FromResource("Description");
+                this.ExtendedHelpText = FromResource("ExtendedHelpText");
+
+                this.OnExecute(() => new DemoAssociationsFacetsCommand().Run(this));
+            }
+
+            public override IEnumerable<string> SourceCodeFiles
+            {
+                get
+                {
+                    return new string[] { "AssociationsFacetsExample.cs" };
+                }
+            }
+        }
+
+        public int Run(ConfigurationBase cmd)
+        {
+            cmd.Main(new string[0]);
+            return 0;
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/9e389540/src/tools/lucene-cli/commands/demo/demo-distance-facets/DemoDistanceFacetsCommand.cs
----------------------------------------------------------------------
diff --git a/src/tools/lucene-cli/commands/demo/demo-distance-facets/DemoDistanceFacetsCommand.cs b/src/tools/lucene-cli/commands/demo/demo-distance-facets/DemoDistanceFacetsCommand.cs
new file mode 100644
index 0000000..5229279
--- /dev/null
+++ b/src/tools/lucene-cli/commands/demo/demo-distance-facets/DemoDistanceFacetsCommand.cs
@@ -0,0 +1,53 @@
+using Lucene.Net.Demo.Facet;
+using System.Collections.Generic;
+
+namespace Lucene.Net.Cli
+{
+    /*
+     * Licensed to the Apache Software Foundation (ASF) under one or more
+     * contributor license agreements.  See the NOTICE file distributed with
+     * this work for additional information regarding copyright ownership.
+     * The ASF licenses this file to You under the Apache License, Version 2.0
+     * (the "License"); you may not use this file except in compliance with
+     * the License.  You may obtain a copy of the License at
+     *
+     *     http://www.apache.org/licenses/LICENSE-2.0
+     *
+     * Unless required by applicable law or agreed to in writing, software
+     * distributed under the License is distributed on an "AS IS" BASIS,
+     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     * See the License for the specific language governing permissions and
+     * limitations under the License.
+     */
+
+    public class DemoDistanceFacetsCommand : ICommand
+    {
+        public class Configuration : DemoConfiguration
+        {
+            public Configuration(CommandLineOptions options)
+            {
+                this.Main = (args) => DistanceFacetsExample.Main(args);
+
+                this.Name = "distance-facets";
+                this.Description = FromResource("Description");
+                this.ExtendedHelpText = FromResource("ExtendedHelpText");
+
+                this.OnExecute(() => new DemoDistanceFacetsCommand().Run(this));
+            }
+
+            public override IEnumerable<string> SourceCodeFiles
+            {
+                get
+                {
+                    return new string[] { "DistanceFacetsExample.cs" };
+                }
+            }
+        }
+
+        public int Run(ConfigurationBase cmd)
+        {
+            cmd.Main(new string[0]);
+            return 0;
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/9e389540/src/tools/lucene-cli/commands/demo/demo-expression-aggregation-facets/DemoExpressionAggregationFacetsCommand.cs
----------------------------------------------------------------------
diff --git a/src/tools/lucene-cli/commands/demo/demo-expression-aggregation-facets/DemoExpressionAggregationFacetsCommand.cs b/src/tools/lucene-cli/commands/demo/demo-expression-aggregation-facets/DemoExpressionAggregationFacetsCommand.cs
new file mode 100644
index 0000000..2ada74b
--- /dev/null
+++ b/src/tools/lucene-cli/commands/demo/demo-expression-aggregation-facets/DemoExpressionAggregationFacetsCommand.cs
@@ -0,0 +1,53 @@
+using Lucene.Net.Demo.Facet;
+using System.Collections.Generic;
+
+namespace Lucene.Net.Cli
+{
+    /*
+     * Licensed to the Apache Software Foundation (ASF) under one or more
+     * contributor license agreements.  See the NOTICE file distributed with
+     * this work for additional information regarding copyright ownership.
+     * The ASF licenses this file to You under the Apache License, Version 2.0
+     * (the "License"); you may not use this file except in compliance with
+     * the License.  You may obtain a copy of the License at
+     *
+     *     http://www.apache.org/licenses/LICENSE-2.0
+     *
+     * Unless required by applicable law or agreed to in writing, software
+     * distributed under the License is distributed on an "AS IS" BASIS,
+     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     * See the License for the specific language governing permissions and
+     * limitations under the License.
+     */
+
+    public class DemoExpressionAggregationFacetsCommand : ICommand
+    {
+        public class Configuration : DemoConfiguration
+        {
+            public Configuration(CommandLineOptions options)
+            {
+                this.Main = (args) => ExpressionAggregationFacetsExample.Main(args);
+
+                this.Name = "expression-aggregation-facets";
+                this.Description = FromResource("Description");
+                this.ExtendedHelpText = FromResource("ExtendedHelpText");
+
+                this.OnExecute(() => new DemoExpressionAggregationFacetsCommand().Run(this));
+            }
+
+            public override IEnumerable<string> SourceCodeFiles
+            {
+                get
+                {
+                    return new string[] { "ExpressionAggregationFacetsExample.cs" };
+                }
+            }
+        }
+
+        public int Run(ConfigurationBase cmd)
+        {
+            cmd.Main(new string[0]);
+            return 0;
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/9e389540/src/tools/lucene-cli/commands/demo/demo-index-files/DemoIndexFilesCommand.cs
----------------------------------------------------------------------
diff --git a/src/tools/lucene-cli/commands/demo/demo-index-files/DemoIndexFilesCommand.cs b/src/tools/lucene-cli/commands/demo/demo-index-files/DemoIndexFilesCommand.cs
new file mode 100644
index 0000000..70b7768
--- /dev/null
+++ b/src/tools/lucene-cli/commands/demo/demo-index-files/DemoIndexFilesCommand.cs
@@ -0,0 +1,85 @@
+using Lucene.Net.Cli.CommandLine;
+using Lucene.Net.Demo;
+using System.Collections.Generic;
+
+namespace Lucene.Net.Cli
+{
+    /*
+     * Licensed to the Apache Software Foundation (ASF) under one or more
+     * contributor license agreements.  See the NOTICE file distributed with
+     * this work for additional information regarding copyright ownership.
+     * The ASF licenses this file to You under the Apache License, Version 2.0
+     * (the "License"); you may not use this file except in compliance with
+     * the License.  You may obtain a copy of the License at
+     *
+     *     http://www.apache.org/licenses/LICENSE-2.0
+     *
+     * Unless required by applicable law or agreed to in writing, software
+     * distributed under the License is distributed on an "AS IS" BASIS,
+     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     * See the License for the specific language governing permissions and
+     * limitations under the License.
+     */
+
+    public class DemoIndexFilesCommand : ICommand
+    {
+        public class Configuration : DemoConfiguration
+        {
+            public Configuration(CommandLineOptions options)
+            {
+                this.Main = (args) => IndexFiles.Main(args);
+
+                this.Name = "index-files";
+                this.Description = FromResource("Description");
+                this.ExtendedHelpText = FromResource("ExtendedHelpText");
+
+                this.IndexDirectoryArgument = new IndexDirectoryArgument(required: true);
+                this.Arguments.Add(IndexDirectoryArgument);
+                this.SourceDirectoryArgument = this.Argument(
+                    "<SOURCE_DIRECTORY>",
+                    FromResource("SourceDirectoryDescription"));
+                this.UpdateOption = this.Option(
+                    "-u|--update",
+                    FromResource("UpdateDescription"), 
+                    CommandOptionType.NoValue);
+                
+                this.OnExecute(() => new DemoIndexFilesCommand().Run(this));
+            }
+
+            public override IEnumerable<string> SourceCodeFiles
+            {
+                get
+                {
+                    return new string[] { "IndexFiles.cs" };
+                }
+            }
+
+            public CommandArgument IndexDirectoryArgument { get; private set; }
+            public CommandArgument SourceDirectoryArgument { get; private set; }
+            public CommandOption UpdateOption { get; private set; }
+        }
+
+        public int Run(ConfigurationBase cmd)
+        {
+            if (!cmd.ValidateArguments(2))
+            {
+                return 1;
+            }
+
+            var input = cmd as Configuration;
+            var args = new List<string>
+            {
+                input.IndexDirectoryArgument.Value,
+                input.SourceDirectoryArgument.Value
+            };
+
+            if (input.UpdateOption.HasValue())
+            {
+                args.Add("--update");
+            }
+
+            cmd.Main(args.ToArray());
+            return 0;
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/9e389540/src/tools/lucene-cli/commands/demo/demo-multi-category-lists-facets/DemoMultiCategoryListsFacetsCommand.cs
----------------------------------------------------------------------
diff --git a/src/tools/lucene-cli/commands/demo/demo-multi-category-lists-facets/DemoMultiCategoryListsFacetsCommand.cs b/src/tools/lucene-cli/commands/demo/demo-multi-category-lists-facets/DemoMultiCategoryListsFacetsCommand.cs
new file mode 100644
index 0000000..84350a6
--- /dev/null
+++ b/src/tools/lucene-cli/commands/demo/demo-multi-category-lists-facets/DemoMultiCategoryListsFacetsCommand.cs
@@ -0,0 +1,53 @@
+using Lucene.Net.Demo.Facet;
+using System.Collections.Generic;
+
+namespace Lucene.Net.Cli
+{
+    /*
+     * Licensed to the Apache Software Foundation (ASF) under one or more
+     * contributor license agreements.  See the NOTICE file distributed with
+     * this work for additional information regarding copyright ownership.
+     * The ASF licenses this file to You under the Apache License, Version 2.0
+     * (the "License"); you may not use this file except in compliance with
+     * the License.  You may obtain a copy of the License at
+     *
+     *     http://www.apache.org/licenses/LICENSE-2.0
+     *
+     * Unless required by applicable law or agreed to in writing, software
+     * distributed under the License is distributed on an "AS IS" BASIS,
+     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     * See the License for the specific language governing permissions and
+     * limitations under the License.
+     */
+
+    public class DemoMultiCategoryListsFacetsCommand : ICommand
+    {
+        public class Configuration : DemoConfiguration
+        {
+            public Configuration(CommandLineOptions options)
+            {
+                this.Main = (args) => MultiCategoryListsFacetsExample.Main(args);
+
+                this.Name = "multi-category-lists-facets";
+                this.Description = FromResource("Description");
+                this.ExtendedHelpText = FromResource("ExtendedHelpText");
+
+                this.OnExecute(() => new DemoMultiCategoryListsFacetsCommand().Run(this));
+            }
+
+            public override IEnumerable<string> SourceCodeFiles
+            {
+                get
+                {
+                    return new string[] { "MultiCategoryListsFacetsExample.cs" };
+                }
+            }
+        }
+
+        public int Run(ConfigurationBase cmd)
+        {
+            cmd.Main(new string[0]);
+            return 0;
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/9e389540/src/tools/lucene-cli/commands/demo/demo-range-facets/DemoRangeFacetsCommand.cs
----------------------------------------------------------------------
diff --git a/src/tools/lucene-cli/commands/demo/demo-range-facets/DemoRangeFacetsCommand.cs b/src/tools/lucene-cli/commands/demo/demo-range-facets/DemoRangeFacetsCommand.cs
new file mode 100644
index 0000000..187ccb3
--- /dev/null
+++ b/src/tools/lucene-cli/commands/demo/demo-range-facets/DemoRangeFacetsCommand.cs
@@ -0,0 +1,53 @@
+using Lucene.Net.Demo.Facet;
+using System.Collections.Generic;
+
+namespace Lucene.Net.Cli
+{
+    /*
+     * Licensed to the Apache Software Foundation (ASF) under one or more
+     * contributor license agreements.  See the NOTICE file distributed with
+     * this work for additional information regarding copyright ownership.
+     * The ASF licenses this file to You under the Apache License, Version 2.0
+     * (the "License"); you may not use this file except in compliance with
+     * the License.  You may obtain a copy of the License at
+     *
+     *     http://www.apache.org/licenses/LICENSE-2.0
+     *
+     * Unless required by applicable law or agreed to in writing, software
+     * distributed under the License is distributed on an "AS IS" BASIS,
+     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     * See the License for the specific language governing permissions and
+     * limitations under the License.
+     */
+
+    public class DemoRangeFacetsCommand : ICommand
+    {
+        public class Configuration : DemoConfiguration
+        {
+            public Configuration(CommandLineOptions options)
+            {
+                this.Main = (args) => RangeFacetsExample.Main(args);
+
+                this.Name = "range-facets";
+                this.Description = FromResource("Description");
+                this.ExtendedHelpText = FromResource("ExtendedHelpText");
+
+                this.OnExecute(() => new DemoRangeFacetsCommand().Run(this));
+            }
+
+            public override IEnumerable<string> SourceCodeFiles
+            {
+                get
+                {
+                    return new string[] { "RangeFacetsExample.cs" };
+                }
+            }
+        }
+
+        public int Run(ConfigurationBase cmd)
+        {
+            cmd.Main(new string[0]);
+            return 0;
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/9e389540/src/tools/lucene-cli/commands/demo/demo-search-files/DemoSearchFilesCommand.cs
----------------------------------------------------------------------
diff --git a/src/tools/lucene-cli/commands/demo/demo-search-files/DemoSearchFilesCommand.cs b/src/tools/lucene-cli/commands/demo/demo-search-files/DemoSearchFilesCommand.cs
new file mode 100644
index 0000000..b40e9c8
--- /dev/null
+++ b/src/tools/lucene-cli/commands/demo/demo-search-files/DemoSearchFilesCommand.cs
@@ -0,0 +1,134 @@
+using Lucene.Net.Cli.CommandLine;
+using Lucene.Net.Demo;
+using System.Collections.Generic;
+
+namespace Lucene.Net.Cli
+{
+    /*
+     * Licensed to the Apache Software Foundation (ASF) under one or more
+     * contributor license agreements.  See the NOTICE file distributed with
+     * this work for additional information regarding copyright ownership.
+     * The ASF licenses this file to You under the Apache License, Version 2.0
+     * (the "License"); you may not use this file except in compliance with
+     * the License.  You may obtain a copy of the License at
+     *
+     *     http://www.apache.org/licenses/LICENSE-2.0
+     *
+     * Unless required by applicable law or agreed to in writing, software
+     * distributed under the License is distributed on an "AS IS" BASIS,
+     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     * See the License for the specific language governing permissions and
+     * limitations under the License.
+     */
+
+    public class DemoSearchFilesCommand : ICommand
+    {
+        public class Configuration : DemoConfiguration
+        {
+            public Configuration(CommandLineOptions options)
+            {
+                this.Main = (args) => SearchFiles.Main(args);
+
+                this.Name = "search-files";
+                this.Description = FromResource("Description");
+                this.ExtendedHelpText = FromResource("ExtendedHelpText");
+
+                this.IndexDirectoryArgument = new IndexDirectoryArgument(required: true);
+                this.Arguments.Add(IndexDirectoryArgument);
+                this.FieldOption = this.Option(
+                    "-f|--field <FIELD>",
+                    FromResource("FieldDescription"), 
+                    CommandOptionType.SingleValue);
+                this.RepeatOption = this.Option(
+                    "-r|--repeat <NUMBER>",
+                    FromResource("RepeatDescription"),
+                    CommandOptionType.SingleValue);
+                this.QueriesFileOption = this.Option(
+                    "-qf|--queries-file <PATH>",
+                    FromResource("QueriesFileDescription"),
+                    CommandOptionType.SingleValue);
+                this.QueryOption = this.Option(
+                    "-q|--query <QUERY>",
+                    FromResource("QueryDescription"),
+                    CommandOptionType.SingleValue);
+                this.RawOption = this.Option(
+                    "--raw",
+                    FromResource("RawDescription"),
+                    CommandOptionType.NoValue);
+                this.PageSizeOption = this.Option(
+                    "-p|--page-size <NUMBER>",
+                    FromResource("PageSizeDescription"),
+                    CommandOptionType.NoValue);
+
+
+                this.OnExecute(() => new DemoSearchFilesCommand().Run(this));
+            }
+
+            public override IEnumerable<string> SourceCodeFiles
+            {
+                get
+                {
+                    return new string[] { "SearchFiles.cs" };
+                }
+            }
+
+            public CommandArgument IndexDirectoryArgument { get; private set; }
+            public CommandOption FieldOption { get; private set; }
+            public CommandOption RepeatOption { get; private set; }
+            public CommandOption QueriesFileOption { get; private set; }
+            public CommandOption QueryOption { get; private set; }
+            public CommandOption RawOption { get; private set; }
+            public CommandOption PageSizeOption { get; private set; }
+        }
+
+        public int Run(ConfigurationBase cmd)
+        {
+            if (!cmd.ValidateArguments(1))
+            {
+                return 1;
+            }
+
+            var input = cmd as Configuration;
+            var args = new List<string> { input.IndexDirectoryArgument.Value };
+
+            if (input.FieldOption.HasValue())
+            {
+                args.Add("--field");
+                args.Add(input.FieldOption.Value());
+            }
+
+            if (input.RepeatOption.HasValue())
+            {
+                args.Add("--repeat");
+                args.Add(input.RepeatOption.Value());
+            }
+
+            if (input.QueriesFileOption.HasValue())
+            {
+                args.Add("--queries-file");
+                args.Add(input.QueriesFileOption.Value());
+            }
+
+            if (input.QueryOption.HasValue())
+            {
+                args.Add("--query");
+                args.Add(input.QueryOption.Value());
+            }
+
+            if (input.RawOption.HasValue())
+            {
+                args.Add("--raw");
+                args.Add(input.RawOption.Value());
+            }
+
+            if (input.PageSizeOption.HasValue())
+            {
+                args.Add("--page-size");
+                args.Add(input.PageSizeOption.Value());
+            }
+
+            cmd.Main(args.ToArray());
+            return 0;
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/9e389540/src/tools/lucene-cli/commands/demo/demo-simple-facets/DemoSimpleFacetsCommand.cs
----------------------------------------------------------------------
diff --git a/src/tools/lucene-cli/commands/demo/demo-simple-facets/DemoSimpleFacetsCommand.cs b/src/tools/lucene-cli/commands/demo/demo-simple-facets/DemoSimpleFacetsCommand.cs
new file mode 100644
index 0000000..9839ddc
--- /dev/null
+++ b/src/tools/lucene-cli/commands/demo/demo-simple-facets/DemoSimpleFacetsCommand.cs
@@ -0,0 +1,53 @@
+using Lucene.Net.Demo.Facet;
+using System.Collections.Generic;
+
+namespace Lucene.Net.Cli
+{
+    /*
+     * Licensed to the Apache Software Foundation (ASF) under one or more
+     * contributor license agreements.  See the NOTICE file distributed with
+     * this work for additional information regarding copyright ownership.
+     * The ASF licenses this file to You under the Apache License, Version 2.0
+     * (the "License"); you may not use this file except in compliance with
+     * the License.  You may obtain a copy of the License at
+     *
+     *     http://www.apache.org/licenses/LICENSE-2.0
+     *
+     * Unless required by applicable law or agreed to in writing, software
+     * distributed under the License is distributed on an "AS IS" BASIS,
+     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     * See the License for the specific language governing permissions and
+     * limitations under the License.
+     */
+
+    public class DemoSimpleFacetsCommand : ICommand
+    {
+        public class Configuration : DemoConfiguration
+        {
+            public Configuration(CommandLineOptions options)
+            {
+                this.Main = (args) => SimpleFacetsExample.Main(args);
+
+                this.Name = "simple-facets";
+                this.Description = FromResource("Description");
+                this.ExtendedHelpText = FromResource("ExtendedHelpText");
+
+                this.OnExecute(() => new DemoSimpleFacetsCommand().Run(this));
+            }
+
+            public override IEnumerable<string> SourceCodeFiles
+            {
+                get
+                {
+                    return new string[] { "SimpleFacetsExample.cs" };
+                }
+            }
+        }
+
+        public int Run(ConfigurationBase cmd)
+        {
+            cmd.Main(new string[0]);
+            return 0;
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/9e389540/src/tools/lucene-cli/commands/demo/demo-simple-sorted-set-facets/DemoSimpleSortedSetFacetsCommand.cs
----------------------------------------------------------------------
diff --git a/src/tools/lucene-cli/commands/demo/demo-simple-sorted-set-facets/DemoSimpleSortedSetFacetsCommand.cs b/src/tools/lucene-cli/commands/demo/demo-simple-sorted-set-facets/DemoSimpleSortedSetFacetsCommand.cs
new file mode 100644
index 0000000..a790fc4
--- /dev/null
+++ b/src/tools/lucene-cli/commands/demo/demo-simple-sorted-set-facets/DemoSimpleSortedSetFacetsCommand.cs
@@ -0,0 +1,53 @@
+using Lucene.Net.Demo.Facet;
+using System.Collections.Generic;
+
+namespace Lucene.Net.Cli
+{
+    /*
+     * Licensed to the Apache Software Foundation (ASF) under one or more
+     * contributor license agreements.  See the NOTICE file distributed with
+     * this work for additional information regarding copyright ownership.
+     * The ASF licenses this file to You under the Apache License, Version 2.0
+     * (the "License"); you may not use this file except in compliance with
+     * the License.  You may obtain a copy of the License at
+     *
+     *     http://www.apache.org/licenses/LICENSE-2.0
+     *
+     * Unless required by applicable law or agreed to in writing, software
+     * distributed under the License is distributed on an "AS IS" BASIS,
+     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     * See the License for the specific language governing permissions and
+     * limitations under the License.
+     */
+
+    public class DemoSimpleSortedSetFacetsCommand : ICommand
+    {
+        public class Configuration : DemoConfiguration
+        {
+            public Configuration(CommandLineOptions options)
+            {
+                this.Main = (args) => SimpleSortedSetFacetsExample.Main(args);
+
+                this.Name = "simple-sorted-set-facets";
+                this.Description = FromResource("Description");
+                this.ExtendedHelpText = FromResource("ExtendedHelpText");
+
+                this.OnExecute(() => new DemoSimpleSortedSetFacetsCommand().Run(this));
+            }
+
+            public override IEnumerable<string> SourceCodeFiles
+            {
+                get
+                {
+                    return new string[] { "SimpleSortedSetFacetsExample.cs" };
+                }
+            }
+        }
+
+        public int Run(ConfigurationBase cmd)
+        {
+            cmd.Main(new string[0]);
+            return 0;
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/9e389540/src/tools/lucene-cli/commands/index/IndexCommand.cs
----------------------------------------------------------------------
diff --git a/src/tools/lucene-cli/commands/index/IndexCommand.cs b/src/tools/lucene-cli/commands/index/IndexCommand.cs
new file mode 100644
index 0000000..1665906
--- /dev/null
+++ b/src/tools/lucene-cli/commands/index/IndexCommand.cs
@@ -0,0 +1,53 @@
+namespace Lucene.Net.Cli
+{
+    /*
+     * Licensed to the Apache Software Foundation (ASF) under one or more
+     * contributor license agreements.  See the NOTICE file distributed with
+     * this work for additional information regarding copyright ownership.
+     * The ASF licenses this file to You under the Apache License, Version 2.0
+     * (the "License"); you may not use this file except in compliance with
+     * the License.  You may obtain a copy of the License at
+     *
+     *     http://www.apache.org/licenses/LICENSE-2.0
+     *
+     * Unless required by applicable law or agreed to in writing, software
+     * distributed under the License is distributed on an "AS IS" BASIS,
+     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     * See the License for the specific language governing permissions and
+     * limitations under the License.
+     */
+
+    public class IndexCommand : ICommand
+    {
+        public class Configuration : ConfigurationBase
+        {
+            public Configuration(CommandLineOptions options)
+            {
+                this.Name = "index";
+                this.Description = FromResource("Description");
+
+                this.Commands.Add(new IndexCheckCommand.Configuration(options));
+                this.Commands.Add(new IndexCopySegmentsCommand.Configuration(options));
+                this.Commands.Add(new IndexDeleteSegmentsCommand.Configuration(options));
+                this.Commands.Add(new IndexExtractCfsCommand.Configuration(options));
+                this.Commands.Add(new IndexFixCommand.Configuration(options));
+                this.Commands.Add(new IndexListCfsCommand.Configuration(options));
+                this.Commands.Add(new IndexListHighFreqTermsCommand.Configuration(options));
+                this.Commands.Add(new IndexListSegmentsCommand.Configuration(options));
+                this.Commands.Add(new IndexListTaxonomyStatsCommand.Configuration(options));
+                this.Commands.Add(new IndexListTermInfoCommand.Configuration(options));
+                this.Commands.Add(new IndexMergeCommand.Configuration(options));
+                this.Commands.Add(new IndexSplitCommand.Configuration(options));
+                this.Commands.Add(new IndexUpgradeCommand.Configuration(options));
+
+                this.OnExecute(() => new IndexCommand().Run(this));
+            }
+        }
+
+        public int Run(ConfigurationBase cmd)
+        {
+            cmd.ShowHelp();
+            return 1;
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/9e389540/src/tools/lucene-cli/commands/index/index-check/IndexCheckCommand.cs
----------------------------------------------------------------------
diff --git a/src/tools/lucene-cli/commands/index/index-check/IndexCheckCommand.cs b/src/tools/lucene-cli/commands/index/index-check/IndexCheckCommand.cs
new file mode 100644
index 0000000..11d9e96
--- /dev/null
+++ b/src/tools/lucene-cli/commands/index/index-check/IndexCheckCommand.cs
@@ -0,0 +1,103 @@
+using Lucene.Net.Index;
+using System.Collections.Generic;
+
+namespace Lucene.Net.Cli
+{
+    /*
+     * Licensed to the Apache Software Foundation (ASF) under one or more
+     * contributor license agreements.  See the NOTICE file distributed with
+     * this work for additional information regarding copyright ownership.
+     * The ASF licenses this file to You under the Apache License, Version 2.0
+     * (the "License"); you may not use this file except in compliance with
+     * the License.  You may obtain a copy of the License at
+     *
+     *     http://www.apache.org/licenses/LICENSE-2.0
+     *
+     * Unless required by applicable law or agreed to in writing, software
+     * distributed under the License is distributed on an "AS IS" BASIS,
+     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     * See the License for the specific language governing permissions and
+     * limitations under the License.
+     */
+
+    public class IndexCheckCommand : ICommand
+    {
+        private readonly bool fix;
+
+        public IndexCheckCommand(bool fix)
+        {
+            this.fix = fix;
+        }
+
+        public class Configuration : ConfigurationBase
+        {
+            public Configuration(CommandLineOptions options)
+            {
+                this.Main = (args) => CheckIndex.Main(args);
+
+                this.Name = "check";
+                this.Description = FromResource("Description");
+
+                this.Arguments.Add(new IndexDirectoryArgument());
+                this.Options.Add(new VerboseOption());
+                this.Options.Add(new CrossCheckTermVectorsOption());
+                this.Options.Add(new DirectoryTypeOption());
+                this.Options.Add(new SegmentOption(allowMultiple: true) { Description = FromResource("SegmentsDescription") });
+
+                // NOTE: We are intentionally calling fix here because it is exactly
+                // the same operation minus the -fix argument
+                OnExecute(() => new IndexCheckCommand(fix: false).Run(this));
+            }
+        }
+
+        public int Run(ConfigurationBase cmd)
+        {
+            if (!cmd.ValidateArguments(1))
+            {
+                return 1;
+            }
+
+            var args = new List<string>() { cmd.GetArgument<IndexDirectoryArgument>().Value };
+
+            if (fix)
+            {
+                args.Add("-fix");
+            }
+
+            // get cross check option
+            var crossCheckOption = cmd.GetOption<CrossCheckTermVectorsOption>();
+            if (crossCheckOption != null && crossCheckOption.HasValue())
+            {
+                args.Add("-crossCheckTermVectors");
+            }
+
+            // get vebose option
+            var verboseOption = cmd.GetOption<VerboseOption>();
+            if (verboseOption != null && verboseOption.HasValue())
+            {
+                args.Add("-verbose");
+            }
+
+            // get segment option
+            var segmentOption = cmd.GetOption<SegmentOption>();
+            if (segmentOption != null && segmentOption.HasValue())
+            {
+                foreach (var value in segmentOption.Values)
+                {
+                    args.Add("-segment");
+                    args.Add(value);
+                }
+            }
+
+            var directoryTypeOption = cmd.GetOption<DirectoryTypeOption>();
+            if (directoryTypeOption != null && directoryTypeOption.HasValue())
+            {
+                args.Add("-dir-impl");
+                args.Add(directoryTypeOption.Value());
+            }
+
+            cmd.Main(args.ToArray());
+            return 0;
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/9e389540/src/tools/lucene-cli/commands/index/index-copy-segments/IndexCopySegmentsCommand.cs
----------------------------------------------------------------------
diff --git a/src/tools/lucene-cli/commands/index/index-copy-segments/IndexCopySegmentsCommand.cs b/src/tools/lucene-cli/commands/index/index-copy-segments/IndexCopySegmentsCommand.cs
new file mode 100644
index 0000000..47caa63
--- /dev/null
+++ b/src/tools/lucene-cli/commands/index/index-copy-segments/IndexCopySegmentsCommand.cs
@@ -0,0 +1,54 @@
+using Lucene.Net.Index;
+
+namespace Lucene.Net.Cli
+{
+    /*
+     * Licensed to the Apache Software Foundation (ASF) under one or more
+     * contributor license agreements.  See the NOTICE file distributed with
+     * this work for additional information regarding copyright ownership.
+     * The ASF licenses this file to You under the Apache License, Version 2.0
+     * (the "License"); you may not use this file except in compliance with
+     * the License.  You may obtain a copy of the License at
+     *
+     *     http://www.apache.org/licenses/LICENSE-2.0
+     *
+     * Unless required by applicable law or agreed to in writing, software
+     * distributed under the License is distributed on an "AS IS" BASIS,
+     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     * See the License for the specific language governing permissions and
+     * limitations under the License.
+     */
+
+    public class IndexCopySegmentsCommand : ICommand
+    {
+        public class Configuration : ConfigurationBase
+        {
+            public Configuration(CommandLineOptions options)
+            {
+                this.Main = (args) => IndexSplitter.Main(args);
+
+                this.Name = "copy-segments";
+                this.Description = FromResource("Description");
+
+                this.Argument("<INPUT_DIRECTORY>", FromResource("InputDirectoryDescription"));
+                this.Argument("<OUTPUT_DIRECTORY>", FromResource("OutputDirectoryDescription"));
+                this.Arguments.Add(new SegmentsArgument() { Description = FromResource("SegmentsDescription") });
+
+                this.ExtendedHelpText = FromResource("ExtendedHelpText");
+
+                this.OnExecute(() => new IndexCopySegmentsCommand().Run(this));
+            }
+        }
+
+        public int Run(ConfigurationBase cmd)
+        {
+            if (!cmd.ValidateArguments(3))
+            {
+                return 1;
+            }
+
+            cmd.Main(cmd.GetNonNullArguments());
+            return 0;
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/9e389540/src/tools/lucene-cli/commands/index/index-delete-segments/IndexDeleteSegmentsCommand.cs
----------------------------------------------------------------------
diff --git a/src/tools/lucene-cli/commands/index/index-delete-segments/IndexDeleteSegmentsCommand.cs b/src/tools/lucene-cli/commands/index/index-delete-segments/IndexDeleteSegmentsCommand.cs
new file mode 100644
index 0000000..fd02054
--- /dev/null
+++ b/src/tools/lucene-cli/commands/index/index-delete-segments/IndexDeleteSegmentsCommand.cs
@@ -0,0 +1,66 @@
+using Lucene.Net.Index;
+using System.Collections.Generic;
+using System.Linq;
+
+namespace Lucene.Net.Cli
+{
+    /*
+     * Licensed to the Apache Software Foundation (ASF) under one or more
+     * contributor license agreements.  See the NOTICE file distributed with
+     * this work for additional information regarding copyright ownership.
+     * The ASF licenses this file to You under the Apache License, Version 2.0
+     * (the "License"); you may not use this file except in compliance with
+     * the License.  You may obtain a copy of the License at
+     *
+     *     http://www.apache.org/licenses/LICENSE-2.0
+     *
+     * Unless required by applicable law or agreed to in writing, software
+     * distributed under the License is distributed on an "AS IS" BASIS,
+     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     * See the License for the specific language governing permissions and
+     * limitations under the License.
+     */
+
+    public class IndexDeleteSegmentsCommand : ICommand
+    {
+        public class Configuration : ConfigurationBase
+        {
+            public Configuration(CommandLineOptions options)
+            {
+                this.Main = (args) => IndexSplitter.Main(args);
+
+                this.Name = "delete-segments";
+                this.Description = FromResource("Description");
+
+                this.Arguments.Add(new IndexDirectoryArgument(required: true));
+                this.Arguments.Add(new SegmentsArgument() { Description = FromResource("SegmentsDescription") });
+
+                this.ExtendedHelpText = FromResource("ExtendedHelpText");
+
+                this.OnExecute(() => new IndexDeleteSegmentsCommand().Run(this));
+            }
+        }
+
+        public int Run(ConfigurationBase cmd)
+        {
+            if (!cmd.ValidateArguments(2))
+            {
+                return 1;
+            }
+
+            var args = new List<string>() { cmd.GetNonNullArguments()[0] };
+            var segmentsArgument = cmd.GetArgument<SegmentsArgument>();
+            if (segmentsArgument != null)
+            {
+                foreach(var segment in segmentsArgument.Values)
+                {
+                    args.Add("-d");
+                    args.Add(segment);
+                }
+            }
+
+            cmd.Main(cmd.GetNonNullArguments().Union(new string[] { "-d" }).ToArray());
+            return 0;
+        }
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/9e389540/src/tools/lucene-cli/commands/index/index-extract-cfs/IndexExtractCfsCommand.cs
----------------------------------------------------------------------
diff --git a/src/tools/lucene-cli/commands/index/index-extract-cfs/IndexExtractCfsCommand.cs b/src/tools/lucene-cli/commands/index/index-extract-cfs/IndexExtractCfsCommand.cs
new file mode 100644
index 0000000..c3bce19
--- /dev/null
+++ b/src/tools/lucene-cli/commands/index/index-extract-cfs/IndexExtractCfsCommand.cs
@@ -0,0 +1,47 @@
+using Lucene.Net.Index;
+using System;
+
+namespace Lucene.Net.Cli
+{
+    /*
+     * Licensed to the Apache Software Foundation (ASF) under one or more
+     * contributor license agreements.  See the NOTICE file distributed with
+     * this work for additional information regarding copyright ownership.
+     * The ASF licenses this file to You under the Apache License, Version 2.0
+     * (the "License"); you may not use this file except in compliance with
+     * the License.  You may obtain a copy of the License at
+     *
+     *     http://www.apache.org/licenses/LICENSE-2.0
+     *
+     * Unless required by applicable law or agreed to in writing, software
+     * distributed under the License is distributed on an "AS IS" BASIS,
+     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     * See the License for the specific language governing permissions and
+     * limitations under the License.
+     */
+
+    public class IndexExtractCfsCommand : ICommand
+    {
+        public class Configuration : ConfigurationBase
+        {
+            public Configuration(CommandLineOptions options)
+            {
+                this.Main = (args) => CompoundFileExtractor.Main(args);
+
+                this.Name = "extract-cfs";
+                this.Description = FromResource("Description");
+
+                this.Argument("<CFS_FILE_NAME>", FromResource("CompoundFileNameDescription"));
+                this.Options.Add(new DirectoryTypeOption());
+                
+                this.OnExecute(() => new IndexListCfsCommand(extract: true).Run(this));
+            }
+        }
+
+        public int Run(ConfigurationBase cmd)
+        {
+            // NOTE: We call IndexListCfsCommand, so nothing to do here.
+            throw new NotSupportedException();
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/9e389540/src/tools/lucene-cli/commands/index/index-fix/IndexFixCommand.cs
----------------------------------------------------------------------
diff --git a/src/tools/lucene-cli/commands/index/index-fix/IndexFixCommand.cs b/src/tools/lucene-cli/commands/index/index-fix/IndexFixCommand.cs
new file mode 100644
index 0000000..0418d49
--- /dev/null
+++ b/src/tools/lucene-cli/commands/index/index-fix/IndexFixCommand.cs
@@ -0,0 +1,50 @@
+using Lucene.Net.Index;
+using System;
+
+namespace Lucene.Net.Cli
+{
+    /*
+     * Licensed to the Apache Software Foundation (ASF) under one or more
+     * contributor license agreements.  See the NOTICE file distributed with
+     * this work for additional information regarding copyright ownership.
+     * The ASF licenses this file to You under the Apache License, Version 2.0
+     * (the "License"); you may not use this file except in compliance with
+     * the License.  You may obtain a copy of the License at
+     *
+     *     http://www.apache.org/licenses/LICENSE-2.0
+     *
+     * Unless required by applicable law or agreed to in writing, software
+     * distributed under the License is distributed on an "AS IS" BASIS,
+     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     * See the License for the specific language governing permissions and
+     * limitations under the License.
+     */
+
+    public class IndexFixCommand : ICommand
+    {
+        public class Configuration : ConfigurationBase
+        {
+            public Configuration(CommandLineOptions options)
+            {
+                this.Main = (args) => CheckIndex.Main(args);
+
+                this.Name = "fix";
+                this.Description = FromResource("Description");
+
+                this.Arguments.Add(new IndexDirectoryArgument());
+                this.Options.Add(new VerboseOption());
+                this.Options.Add(new CrossCheckTermVectorsOption());
+                this.Options.Add(new DirectoryTypeOption());
+                this.Options.Add(new SegmentOption(allowMultiple: true) { Description = FromResource("SegmentsDescpription") });
+
+                this.OnExecute(() => new IndexCheckCommand(fix: true).Run(this));
+            }
+        }
+
+        public int Run(ConfigurationBase cmd)
+        {
+            // We call IndexCheckCommand - nothing to do here.
+            throw new NotSupportedException();
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/9e389540/src/tools/lucene-cli/commands/index/index-list-cfs/IndexListCfsCommand.cs
----------------------------------------------------------------------
diff --git a/src/tools/lucene-cli/commands/index/index-list-cfs/IndexListCfsCommand.cs b/src/tools/lucene-cli/commands/index/index-list-cfs/IndexListCfsCommand.cs
new file mode 100644
index 0000000..4b05cbb
--- /dev/null
+++ b/src/tools/lucene-cli/commands/index/index-list-cfs/IndexListCfsCommand.cs
@@ -0,0 +1,72 @@
+using Lucene.Net.Index;
+using System.Collections.Generic;
+using System.Linq;
+
+namespace Lucene.Net.Cli
+{
+    /*
+     * Licensed to the Apache Software Foundation (ASF) under one or more
+     * contributor license agreements.  See the NOTICE file distributed with
+     * this work for additional information regarding copyright ownership.
+     * The ASF licenses this file to You under the Apache License, Version 2.0
+     * (the "License"); you may not use this file except in compliance with
+     * the License.  You may obtain a copy of the License at
+     *
+     *     http://www.apache.org/licenses/LICENSE-2.0
+     *
+     * Unless required by applicable law or agreed to in writing, software
+     * distributed under the License is distributed on an "AS IS" BASIS,
+     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     * See the License for the specific language governing permissions and
+     * limitations under the License.
+     */
+
+    public class IndexListCfsCommand : ICommand
+    {
+        private readonly bool extract;
+        public IndexListCfsCommand(bool extract)
+        {
+            this.extract = extract;
+        }
+
+        public class Configuration : ConfigurationBase
+        {
+            public Configuration(CommandLineOptions options)
+            {
+                this.Main = (args) => CompoundFileExtractor.Main(args);
+
+                this.Name = "list-cfs";
+                this.Description = FromResource("Description");
+
+                this.Argument("<CFS_FILE_NAME>", FromResource("CFSFileNameDescription"));
+                this.Options.Add(new DirectoryTypeOption());
+
+                this.OnExecute(() => new IndexListCfsCommand(extract: false).Run(this));
+            }
+        }
+
+        public int Run(ConfigurationBase cmd)
+        {
+            if (!cmd.ValidateArguments(1))
+            {
+                return 1;
+            }
+
+            var args = new List<string>();
+            if (extract)
+            {
+                args.Add("-extract");
+            }
+
+            var directoryTypeOption = cmd.GetOption<DirectoryTypeOption>();
+            if (directoryTypeOption != null && directoryTypeOption.HasValue())
+            {
+                args.Add("-dir-impl");
+                args.Add(directoryTypeOption.Value());
+            }
+
+            cmd.Main(cmd.GetNonNullArguments().Union(args).ToArray());
+            return 0;
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/9e389540/src/tools/lucene-cli/commands/index/index-list-high-freq-terms/IndexListHighFreqTerms.cs
----------------------------------------------------------------------
diff --git a/src/tools/lucene-cli/commands/index/index-list-high-freq-terms/IndexListHighFreqTerms.cs b/src/tools/lucene-cli/commands/index/index-list-high-freq-terms/IndexListHighFreqTerms.cs
new file mode 100644
index 0000000..ced2b9d
--- /dev/null
+++ b/src/tools/lucene-cli/commands/index/index-list-high-freq-terms/IndexListHighFreqTerms.cs
@@ -0,0 +1,86 @@
+using Lucene.Net.Cli.CommandLine;
+using Lucene.Net.Misc;
+using System.Collections.Generic;
+
+namespace Lucene.Net.Cli
+{
+    /*
+     * Licensed to the Apache Software Foundation (ASF) under one or more
+     * contributor license agreements.  See the NOTICE file distributed with
+     * this work for additional information regarding copyright ownership.
+     * The ASF licenses this file to You under the Apache License, Version 2.0
+     * (the "License"); you may not use this file except in compliance with
+     * the License.  You may obtain a copy of the License at
+     *
+     *     http://www.apache.org/licenses/LICENSE-2.0
+     *
+     * Unless required by applicable law or agreed to in writing, software
+     * distributed under the License is distributed on an "AS IS" BASIS,
+     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     * See the License for the specific language governing permissions and
+     * limitations under the License.
+     */
+
+    public class IndexListHighFreqTermsCommand : ICommand
+    {
+        public class Configuration : ConfigurationBase
+        {
+            public Configuration(CommandLineOptions options)
+            {
+                this.Main = (args) => HighFreqTerms.Main(args);
+
+                this.Name = "list-high-freq-terms";
+                this.Description = FromResource("Description");
+
+                this.Arguments.Add(new IndexDirectoryArgument());
+                this.TotalTermFreqOption = this.Option(
+                    "-t|--total-term-frequency",
+                    FromResource("TotalTermFrequencyDescription"),
+                    CommandOptionType.NoValue);
+                this.NumberOfTermsOption = this.Option(
+                    "-n|--number-of-terms <NUMBER_OF_TERMS>",
+                    FromResource("NumberOfTermsDescription"),
+                    CommandOptionType.SingleValue);
+                this.FieldOption = this.Option(
+                    "-f|--field <FIELD>",
+                    FromResource("FieldDescription"),
+                    CommandOptionType.SingleValue);
+
+                this.OnExecute(() => new IndexListHighFreqTermsCommand().Run(this));
+            }
+
+            public virtual CommandOption TotalTermFreqOption { get; private set; }
+            public virtual CommandOption NumberOfTermsOption { get; private set; }
+            public virtual CommandOption FieldOption { get; private set; }
+        }
+
+        public int Run(ConfigurationBase cmd)
+        {
+            if (!cmd.ValidateArguments(1))
+            {
+                return 1;
+            }
+
+            var args = new List<string>() { cmd.GetArgument<IndexDirectoryArgument>().Value };
+            var input = cmd as Configuration;
+
+            if (input.TotalTermFreqOption != null && input.TotalTermFreqOption.HasValue())
+            {
+                args.Add("-t");
+            }
+
+            if (input.NumberOfTermsOption != null && input.NumberOfTermsOption.HasValue())
+            {
+                args.Add(input.NumberOfTermsOption.Value());
+            }
+
+            if (input.FieldOption != null && input.FieldOption.HasValue())
+            {
+                args.Add(input.FieldOption.Value());
+            }
+
+            cmd.Main(args.ToArray());
+            return 0;
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/9e389540/src/tools/lucene-cli/commands/index/index-list-segments/IndexSegmentListCommand.cs
----------------------------------------------------------------------
diff --git a/src/tools/lucene-cli/commands/index/index-list-segments/IndexSegmentListCommand.cs b/src/tools/lucene-cli/commands/index/index-list-segments/IndexSegmentListCommand.cs
new file mode 100644
index 0000000..ca4d2dc
--- /dev/null
+++ b/src/tools/lucene-cli/commands/index/index-list-segments/IndexSegmentListCommand.cs
@@ -0,0 +1,51 @@
+using Lucene.Net.Index;
+using System.Linq;
+
+namespace Lucene.Net.Cli
+{
+    /*
+     * Licensed to the Apache Software Foundation (ASF) under one or more
+     * contributor license agreements.  See the NOTICE file distributed with
+     * this work for additional information regarding copyright ownership.
+     * The ASF licenses this file to You under the Apache License, Version 2.0
+     * (the "License"); you may not use this file except in compliance with
+     * the License.  You may obtain a copy of the License at
+     *
+     *     http://www.apache.org/licenses/LICENSE-2.0
+     *
+     * Unless required by applicable law or agreed to in writing, software
+     * distributed under the License is distributed on an "AS IS" BASIS,
+     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     * See the License for the specific language governing permissions and
+     * limitations under the License.
+     */
+
+    public class IndexListSegmentsCommand : ICommand
+    {
+        public class Configuration : ConfigurationBase
+        {
+            public Configuration(CommandLineOptions options)
+            {
+                this.Main = (args) => IndexSplitter.Main(args);
+
+                this.Name = "list-segments";
+                this.Description = FromResource("Description");
+
+                this.Arguments.Add(new IndexDirectoryArgument());
+
+                this.OnExecute(() => new IndexListSegmentsCommand().Run(this));
+            }
+        }
+
+        public int Run(ConfigurationBase cmd)
+        {
+            if (!cmd.ValidateArguments(1))
+            {
+                return 1;
+            }
+
+            cmd.Main(cmd.GetNonNullArguments().Union(new string[] { "-l" }).ToArray());
+            return 0;
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/9e389540/src/tools/lucene-cli/commands/index/index-list-taxonomy-stats/IndexListTaxonomyStatsCommand.cs
----------------------------------------------------------------------
diff --git a/src/tools/lucene-cli/commands/index/index-list-taxonomy-stats/IndexListTaxonomyStatsCommand.cs b/src/tools/lucene-cli/commands/index/index-list-taxonomy-stats/IndexListTaxonomyStatsCommand.cs
new file mode 100644
index 0000000..a0336a6
--- /dev/null
+++ b/src/tools/lucene-cli/commands/index/index-list-taxonomy-stats/IndexListTaxonomyStatsCommand.cs
@@ -0,0 +1,62 @@
+using Lucene.Net.Cli.CommandLine;
+using Lucene.Net.Facet.Taxonomy;
+using System.Collections.Generic;
+
+namespace Lucene.Net.Cli
+{
+    /*
+     * Licensed to the Apache Software Foundation (ASF) under one or more
+     * contributor license agreements.  See the NOTICE file distributed with
+     * this work for additional information regarding copyright ownership.
+     * The ASF licenses this file to You under the Apache License, Version 2.0
+     * (the "License"); you may not use this file except in compliance with
+     * the License.  You may obtain a copy of the License at
+     *
+     *     http://www.apache.org/licenses/LICENSE-2.0
+     *
+     * Unless required by applicable law or agreed to in writing, software
+     * distributed under the License is distributed on an "AS IS" BASIS,
+     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     * See the License for the specific language governing permissions and
+     * limitations under the License.
+     */
+
+    public class IndexListTaxonomyStatsCommand : ICommand
+    {
+        public class Configuration : ConfigurationBase
+        {
+            public Configuration(CommandLineOptions options)
+            {
+                this.Main = (args) => PrintTaxonomyStats.Main(args);
+
+                this.Name = "list-taxonomy-stats";
+                this.Description = FromResource("Description");
+
+                this.Arguments.Add(new IndexDirectoryArgument());
+                this.ShowTreeOption = this.Option("-tree|--show-tree", FromResource("ShowTreeOption"), CommandOptionType.NoValue);
+
+                this.OnExecute(() => new IndexListTaxonomyStatsCommand().Run(this));
+            }
+
+            public virtual CommandOption ShowTreeOption { get; private set; }
+        }
+
+        public int Run(ConfigurationBase cmd)
+        {
+            if (!cmd.ValidateArguments(1))
+            {
+                return 1;
+            }
+            var input = cmd as Configuration;
+            var args = new List<string>() { cmd.GetArgument<IndexDirectoryArgument>().Value };
+            
+            if (input.ShowTreeOption != null && input.ShowTreeOption.HasValue())
+            {
+                args.Add("-printTree");
+            }
+
+            cmd.Main(args.ToArray());
+            return 0;
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/9e389540/src/tools/lucene-cli/commands/index/index-list-term-info/IndexListTermInfoCommand.cs
----------------------------------------------------------------------
diff --git a/src/tools/lucene-cli/commands/index/index-list-term-info/IndexListTermInfoCommand.cs b/src/tools/lucene-cli/commands/index/index-list-term-info/IndexListTermInfoCommand.cs
new file mode 100644
index 0000000..780e8d1
--- /dev/null
+++ b/src/tools/lucene-cli/commands/index/index-list-term-info/IndexListTermInfoCommand.cs
@@ -0,0 +1,52 @@
+using Lucene.Net.Misc;
+
+namespace Lucene.Net.Cli
+{
+    /*
+     * Licensed to the Apache Software Foundation (ASF) under one or more
+     * contributor license agreements.  See the NOTICE file distributed with
+     * this work for additional information regarding copyright ownership.
+     * The ASF licenses this file to You under the Apache License, Version 2.0
+     * (the "License"); you may not use this file except in compliance with
+     * the License.  You may obtain a copy of the License at
+     *
+     *     http://www.apache.org/licenses/LICENSE-2.0
+     *
+     * Unless required by applicable law or agreed to in writing, software
+     * distributed under the License is distributed on an "AS IS" BASIS,
+     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     * See the License for the specific language governing permissions and
+     * limitations under the License.
+     */
+
+    public class IndexListTermInfoCommand : ICommand
+    {
+        public class Configuration : ConfigurationBase
+        {
+            public Configuration(CommandLineOptions options)
+            {
+                this.Main = (args) => GetTermInfo.Main(args);
+
+                this.Name = "list-term-info";
+                this.Description = FromResource("Description");
+
+                this.Arguments.Add(new IndexDirectoryArgument(required: true) { Description = FromResource("IndexDirectoryDescription") });
+                this.Argument("<FIELD>", FromResource("FieldDescription"));
+                this.Argument("<TERM>", FromResource("TermDescription"));
+
+                this.OnExecute(() => new IndexListTermInfoCommand().Run(this));
+            }
+        }
+
+        public int Run(ConfigurationBase cmd)
+        {
+            if (!cmd.ValidateArguments(3))
+            {
+                return 1;
+            }
+
+            cmd.Main(cmd.GetNonNullArguments());
+            return 0;
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/9e389540/src/tools/lucene-cli/commands/index/index-merge/IndexMergeCommand.cs
----------------------------------------------------------------------
diff --git a/src/tools/lucene-cli/commands/index/index-merge/IndexMergeCommand.cs b/src/tools/lucene-cli/commands/index/index-merge/IndexMergeCommand.cs
new file mode 100644
index 0000000..a6f1e5e
--- /dev/null
+++ b/src/tools/lucene-cli/commands/index/index-merge/IndexMergeCommand.cs
@@ -0,0 +1,51 @@
+using Lucene.Net.Misc;
+
+namespace Lucene.Net.Cli
+{
+    /*
+     * Licensed to the Apache Software Foundation (ASF) under one or more
+     * contributor license agreements.  See the NOTICE file distributed with
+     * this work for additional information regarding copyright ownership.
+     * The ASF licenses this file to You under the Apache License, Version 2.0
+     * (the "License"); you may not use this file except in compliance with
+     * the License.  You may obtain a copy of the License at
+     *
+     *     http://www.apache.org/licenses/LICENSE-2.0
+     *
+     * Unless required by applicable law or agreed to in writing, software
+     * distributed under the License is distributed on an "AS IS" BASIS,
+     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     * See the License for the specific language governing permissions and
+     * limitations under the License.
+     */
+
+    public class IndexMergeCommand : ICommand
+    {
+        public class Configuration : ConfigurationBase
+        {
+            public Configuration(CommandLineOptions options)
+            {
+                this.Main = (args) => IndexMergeTool.Main(args);
+
+                this.Name = "merge";
+                this.Description = FromResource("Description");
+
+                this.Argument("<OUTPUT_DIRECTORY>", FromResource("OutputDirectoryDescription"));
+                this.Argument("<INPUT_DIRECTORY_1> <INPUT_DIRECTORY_2>[ <INPUT_DIRECTORY_3>...]", FromResource("InputDirectoryDescription"), true);
+
+                this.OnExecute(() => new IndexMergeCommand().Run(this));
+            }
+        }
+
+        public int Run(ConfigurationBase cmd)
+        {
+            if (!cmd.ValidateArguments(3))
+            {
+                return 1;
+            }
+
+            cmd.Main(cmd.GetNonNullArguments());
+            return 0;
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/9e389540/src/tools/lucene-cli/commands/index/index-split/IndexSplitCommand.cs
----------------------------------------------------------------------
diff --git a/src/tools/lucene-cli/commands/index/index-split/IndexSplitCommand.cs b/src/tools/lucene-cli/commands/index/index-split/IndexSplitCommand.cs
new file mode 100644
index 0000000..80bd2eb
--- /dev/null
+++ b/src/tools/lucene-cli/commands/index/index-split/IndexSplitCommand.cs
@@ -0,0 +1,78 @@
+using Lucene.Net.Cli.CommandLine;
+using Lucene.Net.Index;
+using System.Collections.Generic;
+using System.Linq;
+
+namespace Lucene.Net.Cli
+{
+    /*
+     * Licensed to the Apache Software Foundation (ASF) under one or more
+     * contributor license agreements.  See the NOTICE file distributed with
+     * this work for additional information regarding copyright ownership.
+     * The ASF licenses this file to You under the Apache License, Version 2.0
+     * (the "License"); you may not use this file except in compliance with
+     * the License.  You may obtain a copy of the License at
+     *
+     *     http://www.apache.org/licenses/LICENSE-2.0
+     *
+     * Unless required by applicable law or agreed to in writing, software
+     * distributed under the License is distributed on an "AS IS" BASIS,
+     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     * See the License for the specific language governing permissions and
+     * limitations under the License.
+     */
+
+    public class IndexSplitCommand : ICommand
+    {
+        public class Configuration : ConfigurationBase
+        {
+            public Configuration(CommandLineOptions options)
+            {
+                this.Main = (args) => MultiPassIndexSplitter.Main(args);
+
+                this.Name = "split";
+                this.Description = FromResource("Description");
+
+                this.Argument("<OUTPUT_DIRECTORY>", FromResource("OutputDirectoryDescription"));
+                this.Argument("<INPUT_DIRECTORY>[ <INPUT_DIRECTORY_2>...]", FromResource("InputDirectoryDescription"), true);
+                this.NumberOfParts = this.Option("-n |--number-of-parts <NUMBER>", FromResource("NumberOfPartsDescription"), CommandOptionType.SingleValue);
+                this.Sequential = this.Option("-s|--sequential", FromResource("SequentialDescription"), CommandOptionType.NoValue);
+
+                this.OnExecute(() => new IndexSplitCommand().Run(this));
+            }
+
+            public virtual CommandOption NumberOfParts { get; private set; }
+            public virtual CommandOption Sequential { get; private set; }
+        }
+
+        public int Run(ConfigurationBase cmd)
+        {
+            if (!cmd.ValidateArguments(2))
+            {
+                return 1;
+            }
+
+            // The first argument is the output - we need to use the -out switch
+            var args = new List<string>(cmd.GetNonNullArguments().Skip(1));
+
+            args.Add("-out");
+            args.Add(cmd.GetNonNullArguments().First());
+
+            var input = cmd as Configuration;
+
+            if (input.NumberOfParts != null && input.NumberOfParts.HasValue())
+            {
+                args.Add("-num");
+                args.Add(input.NumberOfParts.Value());
+            }
+
+            if (input.Sequential != null && input.Sequential.HasValue())
+            {
+                args.Add("-seq");
+            }
+
+            cmd.Main(args.ToArray());
+            return 0;
+        }
+    }
+}


[21/22] lucenenet git commit: Lucene.Net.Analysis.Phonetic: fixed indentation of project.json

Posted by ni...@apache.org.
Lucene.Net.Analysis.Phonetic: fixed indentation of project.json


Project: http://git-wip-us.apache.org/repos/asf/lucenenet/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucenenet/commit/3b28c513
Tree: http://git-wip-us.apache.org/repos/asf/lucenenet/tree/3b28c513
Diff: http://git-wip-us.apache.org/repos/asf/lucenenet/diff/3b28c513

Branch: refs/heads/master
Commit: 3b28c5130a8814494f4d3574b68e0bd8dee59720
Parents: c487bbc
Author: Shad Storhaug <sh...@shadstorhaug.com>
Authored: Tue Jul 11 12:53:15 2017 +0700
Committer: Shad Storhaug <sh...@shadstorhaug.com>
Committed: Tue Jul 11 12:53:15 2017 +0700

----------------------------------------------------------------------
 src/Lucene.Net.Analysis.Phonetic/project.json | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucenenet/blob/3b28c513/src/Lucene.Net.Analysis.Phonetic/project.json
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Analysis.Phonetic/project.json b/src/Lucene.Net.Analysis.Phonetic/project.json
index 460721b..e69f644 100644
--- a/src/Lucene.Net.Analysis.Phonetic/project.json
+++ b/src/Lucene.Net.Analysis.Phonetic/project.json
@@ -12,7 +12,7 @@
     "tags": [ "lucene.net", "core", "text", "search", "information", "retrieval", "lucene", "apache", "analysis", "index", "query", "soundex", "double", "metaphone", "sounds", "like", "beider", "morse", "cologne", "caverphone", "nysiis", "match", "rating" ]
   },
   "buildOptions": {
-  "compile": {
+    "compile": {
       "includeFiles": [ "../CommonAssemblyInfo.cs" ]
     },
     "embed": {


[13/22] lucenenet git commit: Lucene.Net.Misc.IndexMergeTool: Added try-finally block to properly dispose of directories.

Posted by ni...@apache.org.
Lucene.Net.Misc.IndexMergeTool: Added try-finally block to properly dispose of directories.


Project: http://git-wip-us.apache.org/repos/asf/lucenenet/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucenenet/commit/38187d74
Tree: http://git-wip-us.apache.org/repos/asf/lucenenet/tree/38187d74
Diff: http://git-wip-us.apache.org/repos/asf/lucenenet/diff/38187d74

Branch: refs/heads/master
Commit: 38187d7454c65817c5c0aa6cc7e68d20d3cd8119
Parents: 92db055
Author: Shad Storhaug <sh...@shadstorhaug.com>
Authored: Mon Jul 10 18:06:51 2017 +0700
Committer: Shad Storhaug <sh...@shadstorhaug.com>
Committed: Mon Jul 10 18:06:51 2017 +0700

----------------------------------------------------------------------
 src/Lucene.Net.Misc/Misc/IndexMergeTool.cs | 22 +++++++++++++++-------
 1 file changed, 15 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucenenet/blob/38187d74/src/Lucene.Net.Misc/Misc/IndexMergeTool.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Misc/Misc/IndexMergeTool.cs b/src/Lucene.Net.Misc/Misc/IndexMergeTool.cs
index 2c1b305..dafb743 100644
--- a/src/Lucene.Net.Misc/Misc/IndexMergeTool.cs
+++ b/src/Lucene.Net.Misc/Misc/IndexMergeTool.cs
@@ -46,16 +46,24 @@ namespace Lucene.Net.Misc
                 { OpenMode = OpenMode.CREATE }))
                 {
                     Directory[] indexes = new Directory[args.Length - 1];
-                    for (int i = 1; i < args.Length; i++)
+                    try
                     {
-                        indexes[i - 1] = FSDirectory.Open(new System.IO.DirectoryInfo(args[i]));
-                    }
+                        for (int i = 1; i < args.Length; i++)
+                        {
+                            indexes[i - 1] = FSDirectory.Open(new System.IO.DirectoryInfo(args[i]));
+                        }
 
-                    Console.WriteLine("Merging...");
-                    writer.AddIndexes(indexes);
+                        Console.WriteLine("Merging...");
+                        writer.AddIndexes(indexes);
 
-                    Console.WriteLine("Full merge...");
-                    writer.ForceMerge(1);
+                        Console.WriteLine("Full merge...");
+                        writer.ForceMerge(1);
+                    }
+                    finally
+                    {
+                        // LUCENENET specific - dispose directories
+                        IOUtils.Dispose(indexes);
+                    }
                 }
                 Console.WriteLine("Done.");
             }


[22/22] lucenenet git commit: README.md: Updated NuGet badges, fixed hyperlinks

Posted by ni...@apache.org.
README.md: Updated NuGet badges, fixed hyperlinks


Project: http://git-wip-us.apache.org/repos/asf/lucenenet/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucenenet/commit/e8e1b5a9
Tree: http://git-wip-us.apache.org/repos/asf/lucenenet/tree/e8e1b5a9
Diff: http://git-wip-us.apache.org/repos/asf/lucenenet/diff/e8e1b5a9

Branch: refs/heads/master
Commit: e8e1b5a9cd6c0d6d895466afce7c2ffcfdb0a096
Parents: 3b28c51
Author: Shad Storhaug <sh...@shadstorhaug.com>
Authored: Tue Jul 11 14:41:40 2017 +0700
Committer: Shad Storhaug <sh...@shadstorhaug.com>
Committed: Tue Jul 11 14:41:40 2017 +0700

----------------------------------------------------------------------
 README.md | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucenenet/blob/e8e1b5a9/README.md
----------------------------------------------------------------------
diff --git a/README.md b/README.md
index 6c08308..f4c9773 100644
--- a/README.md
+++ b/README.md
@@ -27,13 +27,14 @@ Working toward Lucene.Net 4.8.0 (currently in BETA)
 
 ## Download
 
-[![NuGet version](https://badge.fury.io/nu/Lucene.Net.svg)](https://www.nuget.org/packages/Lucene.Net/)
+[![NuGet version](https://img.shields.io/nuget/v/Lucene.Net.svg)](https://www.nuget.org/packages/Lucene.Net/)
 
 ```
 PM> Install-Package Lucene.Net
 ```
 
-Or, to install the BETA of 4.8.0, run
+[![NuGet version](https://img.shields.io/nuget/vpre/Lucene.Net.svg)](https://www.nuget.org/packages/Lucene.Net/)
+
 
 ```
 PM> Install-Package Lucene.Net -Pre
@@ -64,7 +65,9 @@ As of 4.8.0, Lucene.Net is now divided into several specialized sub-packages, al
 
 [Lucene.Net WIKI](https://cwiki.apache.org/confluence/display/LUCENENET/Lucene.Net)
 
-We don't yet have API documentation for Lucene.Net 4.8.0, but the API is similar to [Lucene 4.8.0](https://lucene.apache.org/core/4_8_0/). NOTE: We are working on this, but could use more help since it is a massive project. See #206.
+We don't yet have API documentation for Lucene.Net 4.8.0, but the API is similar to [Lucene 4.8.0](https://lucene.apache.org/core/4_8_0/). 
+
+> NOTE: We are working on this, but could use more help since it is a massive project. See [#206](https://github.com/apache/lucenenet/pull/206).
 
 ### Legacy Versions
 
@@ -81,7 +84,7 @@ Lucene.Net is a very large project (over 400,000 executable lines of code and ne
 
 ### Join Mailing Lists
 
-[How to Join/Unsubscribe to/from mailing lists](https://cwiki.apache.org/confluence/display/LUCENENET/Mailing+Lists)
+[How to Join Mailing Lists](https://cwiki.apache.org/confluence/display/LUCENENET/Mailing+Lists)
 
 ### Ask a Question
 


[17/22] lucenenet git commit: Merge branch 'cli'

Posted by ni...@apache.org.
Merge branch 'cli'


Project: http://git-wip-us.apache.org/repos/asf/lucenenet/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucenenet/commit/18a934ce
Tree: http://git-wip-us.apache.org/repos/asf/lucenenet/tree/18a934ce
Diff: http://git-wip-us.apache.org/repos/asf/lucenenet/diff/18a934ce

Branch: refs/heads/master
Commit: 18a934ce4c4531baa5e562968d790d14d8ed864d
Parents: fa4f034 f17e8b7
Author: Shad Storhaug <sh...@shadstorhaug.com>
Authored: Tue Jul 11 12:39:44 2017 +0700
Committer: Shad Storhaug <sh...@shadstorhaug.com>
Committed: Tue Jul 11 12:39:44 2017 +0700

----------------------------------------------------------------------
 Lucene.Net.Portable.sln                         |   26 +
 build/build.ps1                                 |   15 +-
 .../Index/CompoundFileExtractor.cs              |    8 +-
 .../Index/MultiPassIndexSplitter.cs             |  138 ++-
 src/Lucene.Net.Misc/Misc/IndexMergeTool.cs      |   44 +-
 src/Lucene.Net/Index/IndexUpgrader.cs           |    6 +-
 src/Lucene.Net/Properties/AssemblyInfo.cs       |    1 +
 .../Commands/Analysis/AnalysisCommandTest.cs    |   50 +
 .../AnalysisStempelCompileStemsCommandTest.cs   |   59 +
 .../AnalysisStempelPatchStemsCommandTest.cs     |   58 +
 .../Commands/CommandTestCase.cs                 |  178 +++
 .../Demo/DemoAssociationsFacetsCommandTest.cs   |   40 +
 .../Commands/Demo/DemoCommandTest.cs            |   50 +
 .../Demo/DemoDistanceFacetsCommandTest.cs       |   41 +
 ...emoExpressionAggregationFacetsCommandTest.cs |   42 +
 .../Commands/Demo/DemoIndexFilesCommandTest.cs  |   64 ++
 .../DemoMultiCategoryListsFacetsCommandTest.cs  |   40 +
 .../Commands/Demo/DemoRangeFacetsCommandTest.cs |   40 +
 .../Commands/Demo/DemoSearchFilesCommandTest.cs |   67 ++
 .../Demo/DemoSimpleFacetsCommandTest.cs         |   40 +
 .../DemoSimpleSortedSetFacetsCommandTest.cs     |   40 +
 .../Commands/Index/IndexCheckCommandTest.cs     |   68 ++
 .../Commands/Index/IndexCommandTest.cs          |   59 +
 .../Commands/Index/IndexCopySegmentsTest.cs     |   59 +
 .../Index/IndexDeleteSegmentsCommandTest.cs     |   59 +
 .../Index/IndexExtractCfsCommandTest.cs         |   57 +
 .../Commands/Index/IndexFixCommandTest.cs       |  102 ++
 .../Commands/Index/IndexListCfsCommandTest.cs   |   65 ++
 .../Index/IndexListHighFreqTermsCommandTest.cs  |   70 ++
 .../Index/IndexListSegmentsCommandTest.cs       |   66 ++
 .../Index/IndexListTaxonomyStatsCommandTest.cs  |   68 ++
 .../Index/IndexListTermInfoCommandTest.cs       |   63 ++
 .../Commands/Index/IndexMergeCommandTest.cs     |   58 +
 .../Commands/Index/IndexSplitCommandTest.cs     |   98 ++
 .../Commands/Index/IndexUpgradeCommandTest.cs   |  150 +++
 .../Commands/Lock/LockCommandTest.cs            |   59 +
 .../Commands/Lock/LockStressTestCommandTest.cs  |   66 ++
 .../Lock/LockVerifyServerCommandTest.cs         |   61 ++
 .../Commands/RootCommandTest.cs                 |   57 +
 .../EnumerableExtensions.cs                     |   92 ++
 .../Lucene.Net.Tests.Cli/EnvironmentTest.cs     |   23 +
 .../Lucene.Net.Tests.Cli.xproj                  |   22 +
 .../Properties/AssemblyInfo.cs                  |   36 +
 .../SourceCode/SourceCodeParserTest.cs          |   74 ++
 .../SourceCode/TestInputForParser.cs            |   53 +
 .../Lucene.Net.Tests.Cli/StringExtensions.cs    |   32 +
 src/tools/Lucene.Net.Tests.Cli/project.json     |   35 +
 .../lucene-cli/CommandLine/CommandArgument.cs   |   30 +
 .../CommandLine/CommandLineApplication.cs       |  563 ++++++++++
 .../lucene-cli/CommandLine/CommandOption.cs     |  112 ++
 .../lucene-cli/CommandLine/CommandOptionType.cs |   12 +
 .../CommandLine/CommandParsingException.cs      |   18 +
 src/tools/lucene-cli/CommandLineOptions.cs      |   74 ++
 src/tools/lucene-cli/ConfigurationBase.cs       |  130 +++
 src/tools/lucene-cli/ICommand.cs                |   27 +
 src/tools/lucene-cli/Program.cs                 |   35 +
 src/tools/lucene-cli/Properties/AssemblyInfo.cs |   37 +
 .../lucene-cli/Properties/launchSettings.json   |    7 +
 .../lucene-cli/Resources/Strings.Designer.cs    | 1032 ++++++++++++++++++
 src/tools/lucene-cli/Resources/Strings.resx     |  456 ++++++++
 src/tools/lucene-cli/SourceCode/ConsolePager.cs |  198 ++++
 .../lucene-cli/SourceCode/SourceCodeExporter.cs |   59 +
 .../SourceCode/SourceCodeSectionParser.cs       |  100 ++
 .../SourceCode/SourceCodeSectionReader.cs       |  157 +++
 .../arguments/IndexDirectoryArgument.cs         |   57 +
 .../lucene-cli/arguments/SegmentsArgument.cs    |   31 +
 src/tools/lucene-cli/commands/RootCommand.cs    |   46 +
 .../commands/analysis/AnalysisCommand.cs        |   45 +
 .../AnalysisStempelCompileStemsCommand.cs       |   77 ++
 .../AnalysisStempelPatchStemsCommand.cs         |   71 ++
 .../lucene-cli/commands/demo/DemoCommand.cs     |   49 +
 .../commands/demo/DemoConfiguration.cs          |   90 ++
 .../DemoAssociationsFacetsCommand.cs            |   53 +
 .../DemoDistanceFacetsCommand.cs                |   53 +
 .../DemoExpressionAggregationFacetsCommand.cs   |   53 +
 .../demo-index-files/DemoIndexFilesCommand.cs   |   85 ++
 .../DemoMultiCategoryListsFacetsCommand.cs      |   53 +
 .../demo-range-facets/DemoRangeFacetsCommand.cs |   53 +
 .../demo-search-files/DemoSearchFilesCommand.cs |  133 +++
 .../DemoSimpleFacetsCommand.cs                  |   53 +
 .../DemoSimpleSortedSetFacetsCommand.cs         |   53 +
 .../lucene-cli/commands/index/IndexCommand.cs   |   53 +
 .../index/index-check/IndexCheckCommand.cs      |  104 ++
 .../IndexCopySegmentsCommand.cs                 |   53 +
 .../IndexDeleteSegmentsCommand.cs               |   66 ++
 .../index-extract-cfs/IndexExtractCfsCommand.cs |   48 +
 .../commands/index/index-fix/IndexFixCommand.cs |   65 ++
 .../index/index-list-cfs/IndexListCfsCommand.cs |   73 ++
 .../IndexListHighFreqTerms.cs                   |   86 ++
 .../IndexSegmentListCommand.cs                  |   52 +
 .../IndexListTaxonomyStatsCommand.cs            |   63 ++
 .../IndexListTermInfoCommand.cs                 |   53 +
 .../index/index-merge/IndexMergeCommand.cs      |   51 +
 .../index/index-split/IndexSplitCommand.cs      |   84 ++
 .../index/index-upgrade/IndexUpgradeCommand.cs  |   82 ++
 .../lucene-cli/commands/lock/LockCommand.cs     |   42 +
 .../lock-stress-test/LockStressTestCommand.cs   |   57 +
 .../LockVerifyServerCommand.cs                  |   51 +
 src/tools/lucene-cli/docs/analysis/index.md     |   10 +
 .../docs/analysis/stempel-compile-stems.md      |   37 +
 .../docs/analysis/stempel-patch-stems.md        |   34 +
 .../lucene-cli/docs/demo/associations-facets.md |   27 +
 .../lucene-cli/docs/demo/distance-facets.md     |   27 +
 .../docs/demo/expression-aggregation-facets.md  |   27 +
 src/tools/lucene-cli/docs/demo/index-files.md   |   51 +
 src/tools/lucene-cli/docs/demo/index.md         |   17 +
 .../docs/demo/multi-category-lists-facets.md    |   28 +
 src/tools/lucene-cli/docs/demo/range-facets.md  |   27 +
 src/tools/lucene-cli/docs/demo/search-files.md  |   72 ++
 src/tools/lucene-cli/docs/demo/simple-facets.md |   27 +
 .../docs/demo/simple-sorted-set-facets.md       |   29 +
 src/tools/lucene-cli/docs/index.md              |   25 +
 src/tools/lucene-cli/docs/index/check.md        |   55 +
 .../lucene-cli/docs/index/copy-segments.md      |   40 +
 .../lucene-cli/docs/index/delete-segments.md    |   35 +
 src/tools/lucene-cli/docs/index/extract-cfs.md  |   42 +
 src/tools/lucene-cli/docs/index/fix.md          |   54 +
 src/tools/lucene-cli/docs/index/index.md        |   23 +
 src/tools/lucene-cli/docs/index/list-cfs.md     |   36 +
 .../docs/index/list-high-freq-terms.md          |   49 +
 .../lucene-cli/docs/index/list-segments.md      |   32 +
 .../docs/index/list-taxonomy-stats.md           |   38 +
 .../lucene-cli/docs/index/list-term-info.md     |   40 +
 src/tools/lucene-cli/docs/index/merge.md        |   36 +
 src/tools/lucene-cli/docs/index/split.md        |   54 +
 src/tools/lucene-cli/docs/index/upgrade.md      |   52 +
 src/tools/lucene-cli/docs/lock/index.md         |   10 +
 src/tools/lucene-cli/docs/lock/stress-test.md   |   55 +
 src/tools/lucene-cli/docs/lock/verify-server.md |   35 +
 src/tools/lucene-cli/lucene-cli.xproj           |   19 +
 .../options/CrossCheckTermVectorsOption.cs      |   31 +
 .../lucene-cli/options/DirectoryTypeOption.cs   |   30 +
 src/tools/lucene-cli/options/SegmentOption.cs   |   31 +
 src/tools/lucene-cli/options/VerboseOption.cs   |   30 +
 src/tools/lucene-cli/project.json               |   39 +
 135 files changed, 9102 insertions(+), 86 deletions(-)
----------------------------------------------------------------------



[14/22] lucenenet git commit: build\build.ps1: Fixed build script so the restore and pack tasks ignore lucene-cli

Posted by ni...@apache.org.
build\build.ps1: Fixed build script so the restore and pack tasks ignore lucene-cli


Project: http://git-wip-us.apache.org/repos/asf/lucenenet/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucenenet/commit/71d82b67
Tree: http://git-wip-us.apache.org/repos/asf/lucenenet/tree/71d82b67
Diff: http://git-wip-us.apache.org/repos/asf/lucenenet/diff/71d82b67

Branch: refs/heads/master
Commit: 71d82b673d0abde51ac3a6f45eeccd9ab7d7e3db
Parents: 38187d7
Author: Shad Storhaug <sh...@shadstorhaug.com>
Authored: Tue Jul 11 11:05:01 2017 +0700
Committer: Shad Storhaug <sh...@shadstorhaug.com>
Committed: Tue Jul 11 11:05:01 2017 +0700

----------------------------------------------------------------------
 build/build.ps1 | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucenenet/blob/71d82b67/build/build.ps1
----------------------------------------------------------------------
diff --git a/build/build.ps1 b/build/build.ps1
index 312ec01..578c216 100644
--- a/build/build.ps1
+++ b/build/build.ps1
@@ -101,8 +101,12 @@ task Init -depends InstallSDK -description "This task makes sure the build envir
 }
 
 task Restore -description "This task restores the dependencies" {
-	Exec {
-		& dotnet.exe restore $base_directory
+	pushd $base_directory
+		$packages = Get-ChildItem -Path "project.json" -Recurse | ? { !$_.Directory.Name.Contains(".Cli") -and !$_.Directory.Name.Contains("lucene-cli") }
+	popd
+
+	foreach ($package in $packages) {
+		Exec { & dotnet.exe restore $package }
 	}
 }
 
@@ -132,7 +136,12 @@ task Compile -depends Clean, Init -description "This task compiles the solution"
 task Pack -depends Compile -description "This task creates the NuGet packages" {
 	try {
 		pushd $base_directory
-		$packages = Get-ChildItem -Path "project.json" -Recurse | ? { !$_.Directory.Name.Contains(".Test") -and !$_.Directory.Name.Contains(".Demo") }
+		$packages = Get-ChildItem -Path "project.json" -Recurse | ? { 
+			!$_.Directory.Name.Contains(".Test") -and 
+			!$_.Directory.Name.Contains(".Demo") -and 
+			!$_.Directory.Name.Contains(".Cli") -and 
+			!$_.Directory.Name.Contains("lucene-cli")
+		}
 		popd
 
 		Pack-Assemblies $packages


[07/22] lucenenet git commit: Merge branch 'master' into cli

Posted by ni...@apache.org.
Merge branch 'master' into cli


Project: http://git-wip-us.apache.org/repos/asf/lucenenet/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucenenet/commit/3d11d5d5
Tree: http://git-wip-us.apache.org/repos/asf/lucenenet/tree/3d11d5d5
Diff: http://git-wip-us.apache.org/repos/asf/lucenenet/diff/3d11d5d5

Branch: refs/heads/master
Commit: 3d11d5d54e329cd5eb5b11f390b1c055c92c0102
Parents: a70144d 9a8c9f2
Author: Shad Storhaug <sh...@shadstorhaug.com>
Authored: Fri Jul 7 03:27:10 2017 +0700
Committer: Shad Storhaug <sh...@shadstorhaug.com>
Committed: Fri Jul 7 03:27:10 2017 +0700

----------------------------------------------------------------------
 CONTRIBUTING.md                                 | 66 ++++++++++++--------
 README.md                                       | 41 ++++++++++--
 .../Egothor.Stemmer/Compile.cs                  |  4 +-
 3 files changed, 78 insertions(+), 33 deletions(-)
----------------------------------------------------------------------



[11/22] lucenenet git commit: Fixed error reporting, documentation, and added missing Dispose() calls in CLI tools

Posted by ni...@apache.org.
Fixed error reporting, documentation, and added missing Dispose() calls in CLI tools


Project: http://git-wip-us.apache.org/repos/asf/lucenenet/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucenenet/commit/faa85eb3
Tree: http://git-wip-us.apache.org/repos/asf/lucenenet/tree/faa85eb3
Diff: http://git-wip-us.apache.org/repos/asf/lucenenet/diff/faa85eb3

Branch: refs/heads/master
Commit: faa85eb360e413c36ab91f93fc4d65300586bf55
Parents: 70f1559
Author: Shad Storhaug <sh...@shadstorhaug.com>
Authored: Mon Jul 10 14:51:32 2017 +0700
Committer: Shad Storhaug <sh...@shadstorhaug.com>
Committed: Mon Jul 10 14:51:32 2017 +0700

----------------------------------------------------------------------
 .../Index/CompoundFileExtractor.cs              |   8 +-
 .../Index/MultiPassIndexSplitter.cs             | 138 +++++++++++--------
 src/Lucene.Net.Misc/Misc/IndexMergeTool.cs      |  36 ++---
 3 files changed, 102 insertions(+), 80 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucenenet/blob/faa85eb3/src/Lucene.Net.Misc/Index/CompoundFileExtractor.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Misc/Index/CompoundFileExtractor.cs b/src/Lucene.Net.Misc/Index/CompoundFileExtractor.cs
index db9c5be..e8452f5 100644
--- a/src/Lucene.Net.Misc/Index/CompoundFileExtractor.cs
+++ b/src/Lucene.Net.Misc/Index/CompoundFileExtractor.cs
@@ -32,7 +32,7 @@ namespace Lucene.Net.Index
         /// Add the -extract flag to extract files to the current working directory.
         /// In order to make the extracted version of the index work, you have to copy
         /// the segments file from the compound index into the directory where the extracted files are stored. </summary>
-        /// <param name="args"> Usage: org.apache.lucene.index.IndexReader [-extract] &lt;cfsfile&gt; </param>
+        ///// <param name="args"> Usage: org.apache.lucene.index.IndexReader [-extract] &lt;cfsfile&gt; </param>
         public static void Main(string[] args)
         {
             string filename = null;
@@ -51,8 +51,10 @@ namespace Lucene.Net.Index
                 {
                     if (j == args.Length - 1)
                     {
-                        Console.WriteLine("ERROR: missing value for -dir-impl option");
-                        Environment.Exit(1);
+                        // LUCENENET specific - our wrapper console shows the correct usage
+                        throw new ArgumentException("ERROR: missing value for --directory-type option");
+                        //Console.WriteLine("ERROR: missing value for -dir-impl option");
+                        //Environment.Exit(1);
                     }
                     j++;
                     dirImpl = args[j];

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/faa85eb3/src/Lucene.Net.Misc/Index/MultiPassIndexSplitter.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Misc/Index/MultiPassIndexSplitter.cs b/src/Lucene.Net.Misc/Index/MultiPassIndexSplitter.cs
index 4f40250..2a03d89 100644
--- a/src/Lucene.Net.Misc/Index/MultiPassIndexSplitter.cs
+++ b/src/Lucene.Net.Misc/Index/MultiPassIndexSplitter.cs
@@ -133,84 +133,102 @@ namespace Lucene.Net.Index
                 //Environment.Exit(-1);
             }
             List<IndexReader> indexes = new List<IndexReader>();
-            string outDir = null;
-            int numParts = -1;
-            bool seq = false;
-            for (int i = 0; i < args.Length; i++)
+            try
             {
-                if (args[i].Equals("-out"))
+                string outDir = null;
+                int numParts = -1;
+                bool seq = false;
+                for (int i = 0; i < args.Length; i++)
                 {
-                    outDir = args[++i];
+                    if (args[i].Equals("-out"))
+                    {
+                        outDir = args[++i];
+                    }
+                    else if (args[i].Equals("-num"))
+                    {
+                        numParts = Convert.ToInt32(args[++i]);
+                    }
+                    else if (args[i].Equals("-seq"))
+                    {
+                        seq = true;
+                    }
+                    else
+                    {
+                        DirectoryInfo file = new DirectoryInfo(args[i]);
+                        if (!file.Exists)
+                        {
+                            Console.Error.WriteLine("Invalid input path - skipping: " + file);
+                            continue;
+                        }
+                        using (Store.Directory dir = FSDirectory.Open(new DirectoryInfo(args[i])))
+                        {
+                            try
+                            {
+                                if (!DirectoryReader.IndexExists(dir))
+                                {
+                                    Console.Error.WriteLine("Invalid input index - skipping: " + file);
+                                    continue;
+                                }
+                            }
+                            catch (Exception)
+                            {
+                                Console.Error.WriteLine("Invalid input index - skipping: " + file);
+                                continue;
+                            }
+                            indexes.Add(DirectoryReader.Open(dir));
+                        }
+                    }
                 }
-                else if (args[i].Equals("-num"))
+                if (outDir == null)
                 {
-                    numParts = Convert.ToInt32(args[++i]);
+                    throw new Exception("Required argument missing: -out outputDir");
                 }
-                else if (args[i].Equals("-seq"))
+                if (numParts < 2)
                 {
-                    seq = true;
+                    throw new Exception("Invalid value of required argument: -num numParts");
                 }
-                else
+                if (indexes.Count == 0)
+                {
+                    throw new Exception("No input indexes to process");
+                }
+                DirectoryInfo @out = new DirectoryInfo(outDir);
+                @out.Create();
+                if (!new DirectoryInfo(outDir).Exists)
+                {
+                    throw new Exception("Can't create output directory: " + @out);
+                }
+                Store.Directory[] dirs = new Store.Directory[numParts];
+                try
                 {
-                    DirectoryInfo file = new DirectoryInfo(args[i]);
-                    if (!file.Exists)
+                    for (int i = 0; i < numParts; i++)
                     {
-                        Console.Error.WriteLine("Invalid input path - skipping: " + file);
-                        continue;
+                        dirs[i] = FSDirectory.Open(new DirectoryInfo(Path.Combine(@out.FullName, "part-" + i)));
                     }
-                    Store.Directory dir = FSDirectory.Open(new DirectoryInfo(args[i]));
-                    try
+                    MultiPassIndexSplitter splitter = new MultiPassIndexSplitter();
+                    IndexReader input;
+                    if (indexes.Count == 1)
                     {
-                        if (!DirectoryReader.IndexExists(dir))
-                        {
-                            Console.Error.WriteLine("Invalid input index - skipping: " + file);
-                            continue;
-                        }
+                        input = indexes[0];
                     }
-                    catch (Exception)
+                    else
                     {
-                        Console.Error.WriteLine("Invalid input index - skipping: " + file);
-                        continue;
+                        input = new MultiReader(indexes.ToArray());
                     }
-                    indexes.Add(DirectoryReader.Open(dir));
+#pragma warning disable 612, 618
+                    splitter.Split(LuceneVersion.LUCENE_CURRENT, input, dirs, seq);
+#pragma warning restore 612, 618
+                }
+                finally
+                {
+                    // LUCENENET specific - properly dispose directories to prevent resource leaks
+                    IOUtils.Dispose(dirs);
                 }
             }
-            if (outDir == null)
-            {
-                throw new Exception("Required argument missing: -out outputDir");
-            }
-            if (numParts < 2)
-            {
-                throw new Exception("Invalid value of required argument: -num numParts");
-            }
-            if (indexes.Count == 0)
-            {
-                throw new Exception("No input indexes to process");
-            }
-            DirectoryInfo @out = new DirectoryInfo(outDir);
-            @out.Create();
-            if (!new DirectoryInfo(outDir).Exists)
-            {
-                throw new Exception("Can't create output directory: " + @out);
-            }
-            Store.Directory[] dirs = new Store.Directory[numParts];
-            for (int i = 0; i < numParts; i++)
-            {
-                dirs[i] = FSDirectory.Open(new DirectoryInfo(Path.Combine(@out.FullName, "part-" + i)));
-            }
-            MultiPassIndexSplitter splitter = new MultiPassIndexSplitter();
-            IndexReader input;
-            if (indexes.Count == 1)
-            {
-                input = indexes[0];
-            }
-            else
+            finally
             {
-                input = new MultiReader(indexes.ToArray());
+                // LUCENENET specific - properly dispose index readers to prevent resource leaks
+                IOUtils.Dispose(indexes);
             }
-#pragma warning disable 612, 618
-            splitter.Split(LuceneVersion.LUCENE_CURRENT, input, dirs, seq);
-#pragma warning restore 612, 618
         }
 
         /// <summary>

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/faa85eb3/src/Lucene.Net.Misc/Misc/IndexMergeTool.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Misc/Misc/IndexMergeTool.cs b/src/Lucene.Net.Misc/Misc/IndexMergeTool.cs
index de79ff5..2c1b305 100644
--- a/src/Lucene.Net.Misc/Misc/IndexMergeTool.cs
+++ b/src/Lucene.Net.Misc/Misc/IndexMergeTool.cs
@@ -32,31 +32,33 @@ namespace Lucene.Net.Misc
         {
             if (args.Length < 3)
             {
-                Console.Error.WriteLine("Usage: IndexMergeTool <mergedIndex> <index1> <index2> [index3] ...");
-                Environment.Exit(1);
+                // LUCENENET specific - our wrapper console shows the correct usage
+                throw new ArgumentException();
+                //Console.Error.WriteLine("Usage: IndexMergeTool <mergedIndex> <index1> <index2> [index3] ...");
+                //Environment.Exit(1);
             }
-            FSDirectory mergedIndex = FSDirectory.Open(new System.IO.DirectoryInfo(args[0]));
-
-            using (IndexWriter writer = new IndexWriter(mergedIndex, 
-#pragma warning disable 612, 618                
+            using (FSDirectory mergedIndex = FSDirectory.Open(new System.IO.DirectoryInfo(args[0])))
+            {
+                using (IndexWriter writer = new IndexWriter(mergedIndex,
+#pragma warning disable 612, 618
                 new IndexWriterConfig(LuceneVersion.LUCENE_CURRENT, null)
 #pragma warning restore 612, 618
                 { OpenMode = OpenMode.CREATE }))
-            {
-
-                Directory[] indexes = new Directory[args.Length - 1];
-                for (int i = 1; i < args.Length; i++)
                 {
-                    indexes[i - 1] = FSDirectory.Open(new System.IO.DirectoryInfo(args[i]));
-                }
+                    Directory[] indexes = new Directory[args.Length - 1];
+                    for (int i = 1; i < args.Length; i++)
+                    {
+                        indexes[i - 1] = FSDirectory.Open(new System.IO.DirectoryInfo(args[i]));
+                    }
 
-                Console.WriteLine("Merging...");
-                writer.AddIndexes(indexes);
+                    Console.WriteLine("Merging...");
+                    writer.AddIndexes(indexes);
 
-                Console.WriteLine("Full merge...");
-                writer.ForceMerge(1);
+                    Console.WriteLine("Full merge...");
+                    writer.ForceMerge(1);
+                }
+                Console.WriteLine("Done.");
             }
-            Console.WriteLine("Done.");
         }
     }
 }
\ No newline at end of file


[04/22] lucenenet git commit: Added lucene-cli + tests - a wrapper console application so we can run the various utilities and demos in .NET on the command line.

Posted by ni...@apache.org.
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/9e389540/src/tools/Lucene.Net.Tests.Cli/Properties/AssemblyInfo.cs
----------------------------------------------------------------------
diff --git a/src/tools/Lucene.Net.Tests.Cli/Properties/AssemblyInfo.cs b/src/tools/Lucene.Net.Tests.Cli/Properties/AssemblyInfo.cs
new file mode 100644
index 0000000..a5b2792
--- /dev/null
+++ b/src/tools/Lucene.Net.Tests.Cli/Properties/AssemblyInfo.cs
@@ -0,0 +1,36 @@
+/*
+* Licensed to the Apache Software Foundation (ASF) under one or more
+* contributor license agreements.  See the NOTICE file distributed with
+* this work for additional information regarding copyright ownership.
+* The ASF licenses this file to You under the Apache License, Version 2.0
+* (the "License"); you may not use this file except in compliance with
+* the License.  You may obtain a copy of the License at
+*
+*     http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("Lucene.Net.Tests.Cli")]
+[assembly: AssemblyTrademark("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components.  If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("495b65f0-0b01-40fe-9dc8-5a82c49e07ef")]

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/9e389540/src/tools/Lucene.Net.Tests.Cli/SourceCode/SourceCodeParserTest.cs
----------------------------------------------------------------------
diff --git a/src/tools/Lucene.Net.Tests.Cli/SourceCode/SourceCodeParserTest.cs b/src/tools/Lucene.Net.Tests.Cli/SourceCode/SourceCodeParserTest.cs
new file mode 100644
index 0000000..23ae032
--- /dev/null
+++ b/src/tools/Lucene.Net.Tests.Cli/SourceCode/SourceCodeParserTest.cs
@@ -0,0 +1,72 @@
+using Lucene.Net.Support;
+using NUnit.Framework;
+using System.IO;
+using System.Reflection;
+
+namespace Lucene.Net.Cli.SourceCode
+{
+    /*
+     * Licensed to the Apache Software Foundation (ASF) under one or more
+     * contributor license agreements.  See the NOTICE file distributed with
+     * this work for additional information regarding copyright ownership.
+     * The ASF licenses this file to You under the Apache License, Version 2.0
+     * (the "License"); you may not use this file except in compliance with
+     * the License.  You may obtain a copy of the License at
+     *
+     *     http://www.apache.org/licenses/LICENSE-2.0
+     *
+     * Unless required by applicable law or agreed to in writing, software
+     * distributed under the License is distributed on an "AS IS" BASIS,
+     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     * See the License for the specific language governing permissions and
+     * limitations under the License.
+     */
+
+    public class SourceCodeParserTest
+    {
+        [Test]
+        public void TestSourceCodeSectionParser()
+        {
+            var parser = new SourceCodeSectionParser();
+            var thisAssembly = this.GetType().GetTypeInfo().Assembly;
+
+            using (var output = new MemoryStream())
+            {
+                using (var input = thisAssembly.FindAndGetManifestResourceStream(this.GetType(), "TestInputForParser.cs"))
+                {
+                    parser.ParseSourceCodeFiles(input, output);
+                }
+
+                output.Seek(0, SeekOrigin.Begin);
+
+                using (var reader = new StreamReader(output, SourceCodeSectionParser.ENCODING))
+                {
+                    Assert.AreEqual("using System;", reader.ReadLine());
+                    Assert.AreEqual("using System.Collections.Generic;", reader.ReadLine());
+                    Assert.AreEqual("using System.Linq;", reader.ReadLine());
+                    Assert.AreEqual("using System.Threading.Tasks;", reader.ReadLine());
+                    Assert.AreEqual("using System.Reflection;", reader.ReadLine());
+                    Assert.AreEqual("using System.Xml;", reader.ReadLine());
+                    Assert.AreEqual("", reader.ReadLine());
+                    Assert.AreEqual("namespace Lucene.Net.Cli.SourceCode", reader.ReadLine());
+                    Assert.AreEqual("{", reader.ReadLine());
+                    Assert.AreEqual("    public class TestInputForParser", reader.ReadLine());
+                    Assert.AreEqual("    {", reader.ReadLine());
+                    Assert.AreEqual("        public void Foo()", reader.ReadLine());
+                    Assert.AreEqual("        {", reader.ReadLine());
+                    Assert.AreEqual("            Console.WriteLine(\"Foo\");", reader.ReadLine());
+                    Assert.AreEqual("        }", reader.ReadLine());
+                    Assert.AreEqual("", reader.ReadLine());
+                    Assert.AreEqual("        public void Bar()", reader.ReadLine());
+                    Assert.AreEqual("        {", reader.ReadLine());
+                    Assert.AreEqual("            Console.WriteLine(\"Bar2\");", reader.ReadLine());
+                    Assert.AreEqual("        }", reader.ReadLine());
+                    Assert.AreEqual("    }", reader.ReadLine());
+                    Assert.AreEqual("}", reader.ReadLine());
+                    Assert.AreEqual(null, reader.ReadLine());
+                    Assert.AreEqual(null, reader.ReadLine());
+                }
+            }
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/9e389540/src/tools/Lucene.Net.Tests.Cli/SourceCode/TestInputForParser.cs
----------------------------------------------------------------------
diff --git a/src/tools/Lucene.Net.Tests.Cli/SourceCode/TestInputForParser.cs b/src/tools/Lucene.Net.Tests.Cli/SourceCode/TestInputForParser.cs
new file mode 100644
index 0000000..280fc1c
--- /dev/null
+++ b/src/tools/Lucene.Net.Tests.Cli/SourceCode/TestInputForParser.cs
@@ -0,0 +1,53 @@
+// <comment>
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// DO NOT ALTER THIS FILE, it is for testing purposes
+
+// </comment>
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Threading.Tasks;
+// <include>
+////using System.Reflection;
+////using System.Xml;
+// </include>
+
+namespace Lucene.Net.Cli.SourceCode
+{
+    public class TestInputForParser
+    {
+        public void Foo()
+        {
+            Console.WriteLine("Foo");
+        }
+
+        // <comment>
+        public void Bar()
+        {
+            Console.WriteLine("Bar1");
+        }
+        // </comment>
+        // <include>
+        ////public void Bar()
+        ////{
+        ////    Console.WriteLine("Bar2");
+        ////}
+        // </include>
+    }
+}

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/9e389540/src/tools/Lucene.Net.Tests.Cli/StringExtensions.cs
----------------------------------------------------------------------
diff --git a/src/tools/Lucene.Net.Tests.Cli/StringExtensions.cs b/src/tools/Lucene.Net.Tests.Cli/StringExtensions.cs
new file mode 100644
index 0000000..eeb4e80
--- /dev/null
+++ b/src/tools/Lucene.Net.Tests.Cli/StringExtensions.cs
@@ -0,0 +1,68 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text.RegularExpressions;
+
+namespace Lucene.Net.Cli
+{
+    /*
+     * Licensed to the Apache Software Foundation (ASF) under one or more
+     * contributor license agreements.  See the NOTICE file distributed with
+     * this work for additional information regarding copyright ownership.
+     * The ASF licenses this file to You under the Apache License, Version 2.0
+     * (the "License"); you may not use this file except in compliance with
+     * the License.  You may obtain a copy of the License at
+     *
+     *     http://www.apache.org/licenses/LICENSE-2.0
+     *
+     * Unless required by applicable law or agreed to in writing, software
+     * distributed under the License is distributed on an "AS IS" BASIS,
+     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     * See the License for the specific language governing permissions and
+     * limitations under the License.
+     */
+
+    public static class StringExtensions
+    {
+        public static string[] ToArgs(this string input)
+        {
+            return Regex.Replace(input.Trim(), @"\s+", " ").Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries).ToArray();
+        }
+
+        public static string OptionValue(this IEnumerable<string> args, string option)
+        {
+            return args.SkipWhile(a => a != option).Skip(1).FirstOrDefault();
+        }
+
+        public static IList<string> OptionValues(this IEnumerable<string> args, string option)
+        {
+            var argsList = new List<string>(args);
+            var result = new List<string>();
+            for (int i = 0; i < argsList.Count; i++)
+            {
+                string current = argsList[i];
+                if (current == option)
+                {
+                    if (i == argsList.Count - 1)
+                    {
+                        result.Add(null);
+                    }
+                    else
+                    {
+                        current = argsList[i + 1];
+                        if (current != option)
+                        {
+                            result.Add(current);
+                            i++;
+                        }
+                        else
+                        {
+                            result.Add(null);
+                        }
+                    }
+                }
+            }
+            return result;
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/9e389540/src/tools/Lucene.Net.Tests.Cli/project.json
----------------------------------------------------------------------
diff --git a/src/tools/Lucene.Net.Tests.Cli/project.json b/src/tools/Lucene.Net.Tests.Cli/project.json
new file mode 100644
index 0000000..9ff17e3
--- /dev/null
+++ b/src/tools/Lucene.Net.Tests.Cli/project.json
@@ -0,0 +1,35 @@
+{
+  "version": "4.8.0",
+  "title": "Lucene.Net.Tests.Cli",
+  "dependencies": {
+    "dotnet-test-nunit-teamcity": "3.4.0-beta-3",
+    "lucene-cli": "4.8.0",
+    "Lucene.Net": "4.8.0",
+    "Lucene.Net.TestFramework": "4.8.0",
+    "NUnit": "3.5.0"
+  },
+  "testRunner": "nunit-teamcity",
+  "frameworks": {
+    "netcoreapp1.0": {
+      "imports": "dnxcore50",
+      "buildOptions": {
+        "debugType": "portable",
+        "define": [ "NETSTANDARD" ],
+        "compile": {
+          "excludeFiles": [
+            "SourceCode/TestInputForParser.cs"
+          ]
+        },
+        "embed": {
+          "includeFiles": [
+            "SourceCode/TestInputForParser.cs"
+          ]
+        }
+      }
+    }
+  },
+  "runtimes": {
+    "win7-x86": {},
+    "win7-x64": {}
+  }
+}

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/9e389540/src/tools/lucene-cli/CommandLine/CommandArgument.cs
----------------------------------------------------------------------
diff --git a/src/tools/lucene-cli/CommandLine/CommandArgument.cs b/src/tools/lucene-cli/CommandLine/CommandArgument.cs
new file mode 100644
index 0000000..b7081e0
--- /dev/null
+++ b/src/tools/lucene-cli/CommandLine/CommandArgument.cs
@@ -0,0 +1,30 @@
+// Copyright (c) .NET Foundation. All rights reserved.
+// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System.Collections.Generic;
+using System.Linq;
+
+namespace Lucene.Net.Cli.CommandLine
+{
+    public class CommandArgument
+    {
+        public CommandArgument()
+        {
+            Values = new List<string>();
+        }
+
+        //public string Id { get; set; } // used to identify a command in the list
+        public virtual string Name { get; set; }
+        public bool ShowInHelpText { get; set; } = true;
+        public virtual string Description { get; set; }
+        public List<string> Values { get; private set; }
+        public bool MultipleValues { get; set; }
+        public virtual string Value
+        {
+            get
+            {
+                return Values.FirstOrDefault();
+            }
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/9e389540/src/tools/lucene-cli/CommandLine/CommandLineApplication.cs
----------------------------------------------------------------------
diff --git a/src/tools/lucene-cli/CommandLine/CommandLineApplication.cs b/src/tools/lucene-cli/CommandLine/CommandLineApplication.cs
new file mode 100644
index 0000000..978edad
--- /dev/null
+++ b/src/tools/lucene-cli/CommandLine/CommandLineApplication.cs
@@ -0,0 +1,563 @@
+// Copyright (c) .NET Foundation. All rights reserved.
+// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Lucene.Net.Cli.CommandLine
+{
+    public class CommandLineApplication
+    {
+        // Indicates whether the parser should throw an exception when it runs into an unexpected argument.
+        // If this field is set to false, the parser will stop parsing when it sees an unexpected argument, and all
+        // remaining arguments, including the first unexpected argument, will be stored in RemainingArguments property.
+        private readonly bool _throwOnUnexpectedArg;
+
+        public CommandLineApplication(bool throwOnUnexpectedArg = true)
+        {
+            _throwOnUnexpectedArg = throwOnUnexpectedArg;
+            Options = new List<CommandOption>();
+            Arguments = new List<CommandArgument>();
+            Commands = new List<CommandLineApplication>();
+            RemainingArguments = new List<string>();
+            Invoke = () => 0;
+        }
+
+        public CommandLineApplication Parent { get; set; }
+        public virtual string Name { get; set; }
+        public string FullName { get; set; }
+        public string Syntax { get; set; }
+        public virtual string Description { get; set; }
+        public bool ShowInHelpText { get; set; } = true;
+        public string ExtendedHelpText { get; set; }
+        public readonly List<CommandOption> Options;
+        public CommandOption OptionHelp { get; private set; }
+        public CommandOption OptionVersion { get; private set; }
+        public readonly List<CommandArgument> Arguments;
+        public readonly List<string> RemainingArguments;
+        public bool IsShowingInformation { get; protected set; }  // Is showing help or version?
+        public Func<int> Invoke { get; set; }
+        public Func<string> LongVersionGetter { get; set; }
+        public Func<string> ShortVersionGetter { get; set; }
+        public readonly List<CommandLineApplication> Commands;
+        public bool AllowArgumentSeparator { get; set; }
+        public TextWriter Out { get; set; } = Console.Out;
+        public TextWriter Error { get; set; } = Console.Error;
+
+        public IEnumerable<CommandOption> GetOptions()
+        {
+            var expr = Options.AsEnumerable();
+            var rootNode = this;
+            while (rootNode.Parent != null)
+            {
+                rootNode = rootNode.Parent;
+                expr = expr.Concat(rootNode.Options.Where(o => o.Inherited));
+            }
+
+            return expr;
+        }
+
+        public virtual CommandLineApplication Command(string name, Action<CommandLineApplication> configuration,
+            bool throwOnUnexpectedArg = true)
+        {
+            var command = new CommandLineApplication(throwOnUnexpectedArg) { Name = name, Parent = this };
+            Commands.Add(command);
+            configuration(command);
+            return command;
+        }
+
+        public virtual CommandOption Option(string template, string description, CommandOptionType optionType)
+            => Option(template, description, optionType, _ => { }, inherited: false);
+
+        public virtual CommandOption Option(string template, string description, CommandOptionType optionType, bool inherited)
+            => Option(template, description, optionType, _ => { }, inherited);
+
+        public virtual CommandOption Option(string template, string description, CommandOptionType optionType, Action<CommandOption> configuration)
+            => Option(template, description, optionType, configuration, inherited: false);
+
+        public virtual CommandOption Option(string template, string description, CommandOptionType optionType, Action<CommandOption> configuration, bool inherited)
+        {
+            var option = new CommandOption(template, optionType)
+            {
+                Description = description,
+                Inherited = inherited
+            };
+            Options.Add(option);
+            configuration(option);
+            return option;
+        }
+
+        public virtual CommandArgument Argument(string name, string description, bool multipleValues = false)
+        {
+            return Argument(name, description, _ => { }, multipleValues);
+        }
+
+        public virtual CommandArgument Argument(string name, string description, Action<CommandArgument> configuration, bool multipleValues = false)
+        {
+            var lastArg = Arguments.LastOrDefault();
+            if (lastArg != null && lastArg.MultipleValues)
+            {
+                var message = string.Format("The last argument '{0}' accepts multiple values. No more argument can be added.",
+                    lastArg.Name);
+                throw new InvalidOperationException(message);
+            }
+
+            var argument = new CommandArgument { Name = name, Description = description, MultipleValues = multipleValues };
+            Arguments.Add(argument);
+            configuration(argument);
+            return argument;
+        }
+
+        public virtual void OnExecute(Func<int> invoke)
+        {
+            Invoke = invoke;
+        }
+
+        public virtual void OnExecute(Func<Task<int>> invoke)
+        {
+            Invoke = () => invoke().Result;
+        }
+        public virtual int Execute(params string[] args)
+        {
+            CommandLineApplication command = this;
+            CommandOption option = null;
+            IEnumerator<CommandArgument> arguments = null;
+
+            for (var index = 0; index < args.Length; index++)
+            {
+                var arg = args[index];
+                var processed = false;
+                if (!processed && option == null)
+                {
+                    string[] longOption = null;
+                    string[] shortOption = null;
+
+                    if (arg.StartsWith("--"))
+                    {
+                        longOption = arg.Substring(2).Split(new[] { ':', '=' }, 2);
+                    }
+                    else if (arg.StartsWith("-"))
+                    {
+                        shortOption = arg.Substring(1).Split(new[] { ':', '=' }, 2);
+                    }
+                    else // Look for symbols (such as help option)
+                    {
+                        var symbolOption = command.GetOptions().SingleOrDefault(opt => string.Equals(opt.SymbolName, arg, StringComparison.Ordinal));
+                        if (symbolOption != null)
+                        {
+                            shortOption = new string[] { symbolOption.SymbolName, "" };
+                        }
+                    }
+                    if (longOption != null)
+                    {
+                        processed = true;
+                        var longOptionName = longOption[0];
+                        option = command.GetOptions().SingleOrDefault(opt => string.Equals(opt.LongName, longOptionName, StringComparison.Ordinal));
+
+                        if (option == null)
+                        {
+                            if (string.IsNullOrEmpty(longOptionName) && !command._throwOnUnexpectedArg && AllowArgumentSeparator)
+                            {
+                                // skip over the '--' argument separator
+                                index++;
+                            }
+
+                            HandleUnexpectedArg(command, args, index, argTypeName: "option");
+                            break;
+                        }
+
+                        // If we find a help/version option, show information and stop parsing
+                        if (command.OptionHelp == option)
+                        {
+                            command.ShowHelp();
+                            return 0;
+                        }
+                        else if (command.OptionVersion == option)
+                        {
+                            command.ShowVersion();
+                            return 0;
+                        }
+
+                        if (longOption.Length == 2)
+                        {
+                            if (!option.TryParse(longOption[1]))
+                            {
+                                command.ShowHint();
+                                throw new CommandParsingException(command, $"Unexpected value '{longOption[1]}' for option '{option.LongName}'");
+                            }
+                            option = null;
+                        }
+                        else if (option.OptionType == CommandOptionType.NoValue)
+                        {
+                            // No value is needed for this option
+                            option.TryParse(null);
+                            option = null;
+                        }
+                    }
+                    if (shortOption != null)
+                    {
+                        processed = true;
+                        option = command.GetOptions().SingleOrDefault(opt => string.Equals(opt.ShortName, shortOption[0], StringComparison.Ordinal));
+
+                        // If not a short option, try symbol option
+                        if (option == null)
+                        {
+                            option = command.GetOptions().SingleOrDefault(opt => string.Equals(opt.SymbolName, shortOption[0], StringComparison.Ordinal));
+                        }
+
+                        if (option == null)
+                        {
+                            HandleUnexpectedArg(command, args, index, argTypeName: "option");
+                            break;
+                        }
+
+                        // If we find a help/version option, show information and stop parsing
+                        if (command.OptionHelp == option)
+                        {
+                            command.ShowHelp();
+                            return 0;
+                        }
+                        else if (command.OptionVersion == option)
+                        {
+                            command.ShowVersion();
+                            return 0;
+                        }
+
+                        if (shortOption.Length == 2)
+                        {
+                            if (!option.TryParse(shortOption[1]))
+                            {
+                                command.ShowHint();
+                                throw new CommandParsingException(command, $"Unexpected value '{shortOption[1]}' for option '{option.LongName}'");
+                            }
+                            option = null;
+                        }
+                        else if (option.OptionType == CommandOptionType.NoValue)
+                        {
+                            // No value is needed for this option
+                            option.TryParse(null);
+                            option = null;
+                        }
+                    }
+                }
+
+                if (!processed && option != null)
+                {
+                    processed = true;
+                    if (!option.TryParse(arg))
+                    {
+                        command.ShowHint();
+                        throw new CommandParsingException(command, $"Unexpected value '{arg}' for option '{option.LongName}'");
+                    }
+                    option = null;
+                }
+
+                if (!processed && arguments == null)
+                {
+                    var currentCommand = command;
+                    foreach (var subcommand in command.Commands)
+                    {
+                        if (string.Equals(subcommand.Name, arg, StringComparison.OrdinalIgnoreCase))
+                        {
+                            processed = true;
+                            command = subcommand;
+                            break;
+                        }
+                    }
+
+                    // If we detect a subcommand
+                    if (command != currentCommand)
+                    {
+                        processed = true;
+                    }
+                }
+                if (!processed)
+                {
+                    if (arguments == null)
+                    {
+                        arguments = new CommandArgumentEnumerator(command.Arguments.GetEnumerator());
+                    }
+                    if (arguments.MoveNext())
+                    {
+                        processed = true;
+                        arguments.Current.Values.Add(arg);
+                    }
+                }
+                if (!processed)
+                {
+                    HandleUnexpectedArg(command, args, index, argTypeName: "command or argument");
+                    break;
+                }
+            }
+
+            if (option != null)
+            {
+                command.ShowHint();
+                throw new CommandParsingException(command, $"Missing value for option '{option.LongName}'");
+            }
+
+            return command.Invoke();
+        }
+
+        // Helper method that adds a help option
+        public virtual CommandOption HelpOption(string template)
+        {
+            // Help option is special because we stop parsing once we see it
+            // So we store it separately for further use
+            OptionHelp = Option(template, "Show help information", CommandOptionType.NoValue);
+
+            return OptionHelp;
+        }
+
+        public virtual CommandOption VersionOption(string template,
+            string shortFormVersion,
+            string longFormVersion = null)
+        {
+            if (longFormVersion == null)
+            {
+                return VersionOption(template, () => shortFormVersion);
+            }
+            else
+            {
+                return VersionOption(template, () => shortFormVersion, () => longFormVersion);
+            }
+        }
+
+        // Helper method that adds a version option
+        public virtual CommandOption VersionOption(string template,
+            Func<string> shortFormVersionGetter,
+            Func<string> longFormVersionGetter = null)
+        {
+            // Version option is special because we stop parsing once we see it
+            // So we store it separately for further use
+            OptionVersion = Option(template, "Show version information", CommandOptionType.NoValue);
+            ShortVersionGetter = shortFormVersionGetter;
+            LongVersionGetter = longFormVersionGetter ?? shortFormVersionGetter;
+
+            return OptionVersion;
+        }
+
+        // Show short hint that reminds users to use help option
+        public virtual void ShowHint()
+        {
+            if (OptionHelp != null)
+            {
+                Out.WriteLine(string.Format("Specify --{0} for a list of available options and commands.", OptionHelp.LongName));
+            }
+        }
+
+        // Show full help
+        public virtual void ShowHelp(string commandName = null)
+        {
+            for (var cmd = this; cmd != null; cmd = cmd.Parent)
+            {
+                cmd.IsShowingInformation = true;
+            }
+
+            Out.WriteLine(GetHelpText(commandName));
+        }
+
+        public virtual string GetHelpText(string commandName = null)
+        {
+            var headerBuilder = new StringBuilder("Usage:");
+            for (var cmd = this; cmd != null; cmd = cmd.Parent)
+            {
+                headerBuilder.Insert(6, string.Format(" {0}", cmd.Name));
+            }
+
+            CommandLineApplication target;
+
+            if (commandName == null || string.Equals(Name, commandName, StringComparison.OrdinalIgnoreCase))
+            {
+                target = this;
+            }
+            else
+            {
+                target = Commands.SingleOrDefault(cmd => string.Equals(cmd.Name, commandName, StringComparison.OrdinalIgnoreCase));
+
+                if (target != null)
+                {
+                    headerBuilder.AppendFormat(" {0}", commandName);
+                }
+                else
+                {
+                    // The command name is invalid so don't try to show help for something that doesn't exist
+                    target = this;
+                }
+
+            }
+
+            var optionsBuilder = new StringBuilder();
+            var commandsBuilder = new StringBuilder();
+            var argumentsBuilder = new StringBuilder();
+
+            var arguments = target.Arguments.Where(a => a.ShowInHelpText).ToList();
+            if (arguments.Any())
+            {
+                headerBuilder.Append(" [arguments]");
+
+                argumentsBuilder.AppendLine();
+                argumentsBuilder.AppendLine("Arguments:");
+                var maxArgLen = arguments.Max(a => a.Name.Length);
+                var outputFormat = string.Format("  {{0, -{0}}}{{1}}", maxArgLen + 2);
+                foreach (var arg in arguments)
+                {
+                    argumentsBuilder.AppendFormat(outputFormat, arg.Name, arg.Description);
+                    argumentsBuilder.AppendLine();
+                }
+            }
+
+            var options = target.GetOptions().Where(o => o.ShowInHelpText).ToList();
+            if (options.Any())
+            {
+                headerBuilder.Append(" [options]");
+
+                optionsBuilder.AppendLine();
+                optionsBuilder.AppendLine("Options:");
+                var maxOptLen = options.Max(o => o.Template.Length);
+                var outputFormat = string.Format("  {{0, -{0}}}{{1}}", maxOptLen + 2);
+                foreach (var opt in options)
+                {
+                    optionsBuilder.AppendFormat(outputFormat, opt.Template, opt.Description);
+                    optionsBuilder.AppendLine();
+                }
+            }
+
+            var commands = target.Commands.Where(c => c.ShowInHelpText).ToList();
+            if (commands.Any())
+            {
+                headerBuilder.Append(" [command]");
+
+                commandsBuilder.AppendLine();
+                commandsBuilder.AppendLine("Commands:");
+                var maxCmdLen = commands.Max(c => c.Name.Length);
+                var outputFormat = string.Format("  {{0, -{0}}}{{1}}", maxCmdLen + 2);
+                foreach (var cmd in commands.OrderBy(c => c.Name))
+                {
+                    commandsBuilder.AppendFormat(outputFormat, cmd.Name, cmd.Description);
+                    commandsBuilder.AppendLine();
+                }
+
+                if (OptionHelp != null)
+                {
+                    commandsBuilder.AppendLine();
+                    commandsBuilder.AppendFormat($"Use \"{target.Name} [command] --{OptionHelp.LongName}\" for more information about a command.");
+                    commandsBuilder.AppendLine();
+                }
+            }
+
+            if (target.AllowArgumentSeparator)
+            {
+                headerBuilder.Append(" [[--] <arg>...]");
+            }
+
+            headerBuilder.AppendLine();
+
+            var nameAndVersion = new StringBuilder();
+            nameAndVersion.AppendLine(GetFullNameAndVersion());
+            nameAndVersion.AppendLine();
+
+            return nameAndVersion.ToString()
+                + headerBuilder.ToString()
+                + argumentsBuilder.ToString()
+                + optionsBuilder.ToString()
+                + commandsBuilder.ToString()
+                + (string.IsNullOrEmpty(target.ExtendedHelpText) ? "" : Environment.NewLine + target.ExtendedHelpText);
+        }
+
+        public virtual void ShowVersion()
+        {
+            for (var cmd = this; cmd != null; cmd = cmd.Parent)
+            {
+                cmd.IsShowingInformation = true;
+            }
+
+            Out.WriteLine(FullName);
+            Out.WriteLine(LongVersionGetter());
+        }
+
+        public virtual string GetFullNameAndVersion()
+        {
+            return ShortVersionGetter == null ? FullName : string.Format("{0} {1}", FullName, ShortVersionGetter());
+        }
+
+        public virtual void ShowRootCommandFullNameAndVersion()
+        {
+            var rootCmd = this;
+            while (rootCmd.Parent != null)
+            {
+                rootCmd = rootCmd.Parent;
+            }
+
+            Out.WriteLine(rootCmd.GetFullNameAndVersion());
+            Out.WriteLine();
+        }
+
+        private void HandleUnexpectedArg(CommandLineApplication command, string[] args, int index, string argTypeName)
+        {
+            if (command._throwOnUnexpectedArg)
+            {
+                command.ShowHint();
+                throw new CommandParsingException(command, $"Unrecognized {argTypeName} '{args[index]}'");
+            }
+            else
+            {
+                // All remaining arguments are stored for further use
+                command.RemainingArguments.AddRange(new ArraySegment<string>(args, index, args.Length - index));
+            }
+        }
+
+        private class CommandArgumentEnumerator : IEnumerator<CommandArgument>
+        {
+            private readonly IEnumerator<CommandArgument> _enumerator;
+
+            public CommandArgumentEnumerator(IEnumerator<CommandArgument> enumerator)
+            {
+                _enumerator = enumerator;
+            }
+
+            public CommandArgument Current
+            {
+                get
+                {
+                    return _enumerator.Current;
+                }
+            }
+
+            object IEnumerator.Current
+            {
+                get
+                {
+                    return Current;
+                }
+            }
+
+            public void Dispose()
+            {
+                _enumerator.Dispose();
+            }
+
+            public bool MoveNext()
+            {
+                if (Current == null || !Current.MultipleValues)
+                {
+                    return _enumerator.MoveNext();
+                }
+
+                // If current argument allows multiple values, we don't move forward and
+                // all later values will be added to current CommandArgument.Values
+                return true;
+            }
+
+            public void Reset()
+            {
+                _enumerator.Reset();
+            }
+        }
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/9e389540/src/tools/lucene-cli/CommandLine/CommandOption.cs
----------------------------------------------------------------------
diff --git a/src/tools/lucene-cli/CommandLine/CommandOption.cs b/src/tools/lucene-cli/CommandLine/CommandOption.cs
new file mode 100644
index 0000000..16c1025
--- /dev/null
+++ b/src/tools/lucene-cli/CommandLine/CommandOption.cs
@@ -0,0 +1,112 @@
+// Copyright (c) .NET Foundation. All rights reserved.
+// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+
+namespace Lucene.Net.Cli.CommandLine
+{
+    public class CommandOption
+    {
+        public CommandOption(string template, CommandOptionType optionType)
+        {
+            Template = template;
+            OptionType = optionType;
+            Values = new List<string>();
+
+            foreach (var part in Template.Split(new[] { ' ', '|' }, StringSplitOptions.RemoveEmptyEntries))
+            {
+                if (part.StartsWith("--"))
+                {
+                    LongName = part.Substring(2);
+                }
+                else if (part.StartsWith("-"))
+                {
+                    var optName = part.Substring(1);
+
+                    // If there is only one char and it is not an English letter, it is a symbol option (e.g. "-?")
+                    if (optName.Length == 1 && !IsEnglishLetter(optName[0]))
+                    {
+                        SymbolName = optName;
+                    }
+                    else
+                    {
+                        ShortName = optName;
+                    }
+                }
+                else if (part.StartsWith("<") && part.EndsWith(">"))
+                {
+                    ValueName = part.Substring(1, part.Length - 2);
+                }
+                else
+                {
+                    throw new ArgumentException($"Invalid template pattern '{template}'", nameof(template));
+                }
+            }
+
+            if (string.IsNullOrEmpty(LongName) && string.IsNullOrEmpty(ShortName) && string.IsNullOrEmpty(SymbolName))
+            {
+                throw new ArgumentException($"Invalid template pattern '{template}'", nameof(template));
+            }
+        }
+
+        /// <summary>
+        /// An ID that can be used to locate this option.
+        /// </summary>
+        public string UniqueId { get; set; }
+        public string Template { get; set; }
+        public string ShortName { get; set; }
+        public string LongName { get; set; }
+        public string SymbolName { get; set; }
+        public string ValueName { get; set; }
+        public string Description { get; set; }
+        public List<string> Values { get; private set; }
+        public CommandOptionType OptionType { get; private set; }
+        public bool ShowInHelpText { get; set; } = true;
+        public bool Inherited { get; set; }
+
+        public bool TryParse(string value)
+        {
+            switch (OptionType)
+            {
+                case CommandOptionType.MultipleValue:
+                    Values.Add(value);
+                    break;
+                case CommandOptionType.SingleValue:
+                    if (Values.Any())
+                    {
+                        return false;
+                    }
+                    Values.Add(value);
+                    break;
+                case CommandOptionType.NoValue:
+                    if (value != null)
+                    {
+                        return false;
+                    }
+                    // Add a value to indicate that this option was specified
+                    Values.Add("on");
+                    break;
+                default:
+                    break;
+            }
+            return true;
+        }
+
+        public bool HasValue()
+        {
+            return Values.Any();
+        }
+
+        public string Value()
+        {
+            return HasValue() ? Values[0] : null;
+        }
+
+        private bool IsEnglishLetter(char c)
+        {
+            return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z');
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/9e389540/src/tools/lucene-cli/CommandLine/CommandOptionType.cs
----------------------------------------------------------------------
diff --git a/src/tools/lucene-cli/CommandLine/CommandOptionType.cs b/src/tools/lucene-cli/CommandLine/CommandOptionType.cs
new file mode 100644
index 0000000..ef541e4
--- /dev/null
+++ b/src/tools/lucene-cli/CommandLine/CommandOptionType.cs
@@ -0,0 +1,12 @@
+// Copyright (c) .NET Foundation. All rights reserved.
+// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+namespace Lucene.Net.Cli.CommandLine
+{
+    public enum CommandOptionType
+    {
+        MultipleValue,
+        SingleValue,
+        NoValue
+    }
+}

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/9e389540/src/tools/lucene-cli/CommandLine/CommandParsingException.cs
----------------------------------------------------------------------
diff --git a/src/tools/lucene-cli/CommandLine/CommandParsingException.cs b/src/tools/lucene-cli/CommandLine/CommandParsingException.cs
new file mode 100644
index 0000000..bd2446a
--- /dev/null
+++ b/src/tools/lucene-cli/CommandLine/CommandParsingException.cs
@@ -0,0 +1,18 @@
+// Copyright (c) .NET Foundation. All rights reserved.
+// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System;
+
+namespace Lucene.Net.Cli.CommandLine
+{
+    public class CommandParsingException : Exception
+    {
+        public CommandParsingException(CommandLineApplication command, string message)
+            : base(message)
+        {
+            Command = command;
+        }
+
+        public CommandLineApplication Command { get; }
+    }
+}

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/9e389540/src/tools/lucene-cli/CommandLineOptions.cs
----------------------------------------------------------------------
diff --git a/src/tools/lucene-cli/CommandLineOptions.cs b/src/tools/lucene-cli/CommandLineOptions.cs
new file mode 100644
index 0000000..93c7455
--- /dev/null
+++ b/src/tools/lucene-cli/CommandLineOptions.cs
@@ -0,0 +1,74 @@
+using System;
+
+namespace Lucene.Net.Cli
+{
+    /*
+     * Licensed to the Apache Software Foundation (ASF) under one or more
+     * contributor license agreements.  See the NOTICE file distributed with
+     * this work for additional information regarding copyright ownership.
+     * The ASF licenses this file to You under the Apache License, Version 2.0
+     * (the "License"); you may not use this file except in compliance with
+     * the License.  You may obtain a copy of the License at
+     *
+     *     http://www.apache.org/licenses/LICENSE-2.0
+     *
+     * Unless required by applicable law or agreed to in writing, software
+     * distributed under the License is distributed on an "AS IS" BASIS,
+     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     * See the License for the specific language governing permissions and
+     * limitations under the License.
+     */
+
+    public class CommandLineOptions
+    {
+        public static int Parse(string[] args)
+        {
+            var options = new CommandLineOptions();
+
+            var cmd = new RootCommand.Configuration(options);
+
+            try
+            {
+                return cmd.Execute(args);
+            }
+            catch (Exception ex)
+            {
+                Console.WriteLine(Resources.Strings.GeneralExceptionMessage + Environment.NewLine + ex.ToString());
+                cmd.ShowHint();
+                return 1;
+            }
+        }
+
+        //public static readonly string VERBOSE_OPTION_VALUE_NAME = "verbose";
+        //public static readonly string DIRECTORY_TYPE_VALUE_NAME = "directoryType";
+        //public static readonly string INDEX_DIRECTORY_ARGUMENT_ID = "indexDirectory";
+
+        //public CommandOption VerboseOption = new CommandOption("-v|--verbose", CommandOptionType.NoValue)
+        //{
+        //    Description = Resources.Strings.VerboseOptionDescription,
+        //    ValueName = VERBOSE_OPTION_VALUE_NAME
+        //};
+        //public CommandArgument IndexDirectoryArgument = new CommandArgument()
+        //{
+        //    Name = "[<INDEX-DIRECTORY>]",
+        //    Description = Resources.Strings.IndexDirectoryArgumentDescription,
+        //    Id = INDEX_DIRECTORY_ARGUMENT_ID
+        //};
+        //public string IndexDirectory
+        //{
+        //    get
+        //    {
+        //        // Return current directory if index directory not supplied.
+        //        return string.IsNullOrWhiteSpace(IndexDirectoryArgument.Value) ?
+        //            System.AppContext.BaseDirectory :
+        //            IndexDirectoryArgument.Value;
+        //    }
+        //}
+
+        //public CommandOption DirectoryTypeOption = new CommandOption("-dir|-dir-impl|--dir-impl|--directory-type", CommandOptionType.SingleValue)
+        //{
+        //    Description = Resources.Strings.DirectoryTypeOptionDescription,
+        //    ValueName = DIRECTORY_TYPE_VALUE_NAME
+        //};
+    }
+}

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/9e389540/src/tools/lucene-cli/ConfigurationBase.cs
----------------------------------------------------------------------
diff --git a/src/tools/lucene-cli/ConfigurationBase.cs b/src/tools/lucene-cli/ConfigurationBase.cs
new file mode 100644
index 0000000..28e8de5
--- /dev/null
+++ b/src/tools/lucene-cli/ConfigurationBase.cs
@@ -0,0 +1,130 @@
+using Lucene.Net.Cli.CommandLine;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Reflection;
+
+namespace Lucene.Net.Cli
+{
+    /*
+     * Licensed to the Apache Software Foundation (ASF) under one or more
+     * contributor license agreements.  See the NOTICE file distributed with
+     * this work for additional information regarding copyright ownership.
+     * The ASF licenses this file to You under the Apache License, Version 2.0
+     * (the "License"); you may not use this file except in compliance with
+     * the License.  You may obtain a copy of the License at
+     *
+     *     http://www.apache.org/licenses/LICENSE-2.0
+     *
+     * Unless required by applicable law or agreed to in writing, software
+     * distributed under the License is distributed on an "AS IS" BASIS,
+     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     * See the License for the specific language governing permissions and
+     * limitations under the License.
+     */
+
+    public abstract class ConfigurationBase : CommandLineApplication
+    {
+        private static Assembly thisAssembly = typeof(ConfigurationBase).GetTypeInfo().Assembly;
+        protected static string HELP_VALUE_NAME = "help";
+
+        protected ConfigurationBase()
+            //: base(throwOnUnexpectedArg: false)
+        {
+            var help = this.HelpOption("-?|-h|--help");
+            help.UniqueId = HELP_VALUE_NAME;
+            help.ShowInHelpText = false;
+
+            this.ShortVersionGetter = () => 
+            {
+                return "Lucene.Net Command Line Utility, Version: " + thisAssembly
+                    .GetCustomAttribute<AssemblyInformationalVersionAttribute>()
+                    .InformationalVersion;
+            };
+
+            this.LongVersionGetter = () =>
+            {
+                return ShortVersionGetter();
+            };
+        }
+
+        public override void OnExecute(Func<int> invoke)
+        {
+            base.OnExecute(() =>
+            {
+                if (this.GetOptionByUniqueId(HELP_VALUE_NAME).HasValue())
+                {
+                    this.ShowHelp();
+                    return 1;
+                }
+                try
+                {
+                    return invoke();
+                }
+                catch (ArgumentException e)
+                {
+                    // Rather than writing to console, the
+                    // utilities are now throwing ArgumentException
+                    // if the args cannot be parsed.
+                    this.ShowHint();
+                    this.ShowHelp();
+                    return 1;
+                }
+            });
+        }
+
+        public Action<string[]> Main { get; set; }
+
+        public CommandOption GetOptionByUniqueId(string uniqueId)
+        {
+            return this.Options.FirstOrDefault(o => o.UniqueId == uniqueId);
+        }
+
+        public CommandOption GetOption<T>()
+        {
+            return this.Options.FirstOrDefault(o => typeof(T).IsAssignableFrom(o.GetType()));
+        }
+
+        public CommandArgument GetArgument<T>()
+        {
+            return this.Arguments.FirstOrDefault(o => typeof(T).IsAssignableFrom(o.GetType()));
+        }
+
+        /// <summary>
+        /// Gets the resource with a specific name. It is automatically
+        /// prefixed by the current command name.
+        /// </summary>
+        /// <param name="resourceName"></param>
+        /// <returns></returns>
+        protected string FromResource(string resourceName)
+        {
+            return Resources.Strings.ResourceManager.GetString(this.GetType().DeclaringType.Name + resourceName);
+        }
+
+        public void ShowNotEnoughArguments(int minimum)
+        {
+            Out.WriteLine(Resources.Strings.NotEnoughArguments, minimum);
+        }
+
+        public bool ValidateArguments(int minimum)
+        {
+            var args = GetNonNullArguments();
+
+            if (args.Length < minimum)
+            {
+                this.ShowNotEnoughArguments(minimum);
+                this.ShowHelp();
+                return false;
+            }
+            return true;
+        }
+
+        public string[] GetNonNullArguments()
+        {
+            return this.Arguments
+                .Where(a => !string.IsNullOrWhiteSpace(a.Value))
+                .SelectMany(a => a.MultipleValues ? a.Values : new List<string> { a.Value })
+                .ToArray();
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/9e389540/src/tools/lucene-cli/ICommand.cs
----------------------------------------------------------------------
diff --git a/src/tools/lucene-cli/ICommand.cs b/src/tools/lucene-cli/ICommand.cs
new file mode 100644
index 0000000..b84e8d6
--- /dev/null
+++ b/src/tools/lucene-cli/ICommand.cs
@@ -0,0 +1,27 @@
+namespace Lucene.Net.Cli
+{
+    /*
+     * Licensed to the Apache Software Foundation (ASF) under one or more
+     * contributor license agreements.  See the NOTICE file distributed with
+     * this work for additional information regarding copyright ownership.
+     * The ASF licenses this file to You under the Apache License, Version 2.0
+     * (the "License"); you may not use this file except in compliance with
+     * the License.  You may obtain a copy of the License at
+     *
+     *     http://www.apache.org/licenses/LICENSE-2.0
+     *
+     * Unless required by applicable law or agreed to in writing, software
+     * distributed under the License is distributed on an "AS IS" BASIS,
+     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     * See the License for the specific language governing permissions and
+     * limitations under the License.
+     */
+
+    /// <summary>
+    /// A console command.
+    /// </summary>
+    public interface ICommand
+    {
+        int Run(ConfigurationBase cmd);
+    }
+}

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/9e389540/src/tools/lucene-cli/Program.cs
----------------------------------------------------------------------
diff --git a/src/tools/lucene-cli/Program.cs b/src/tools/lucene-cli/Program.cs
new file mode 100644
index 0000000..9ef9869
--- /dev/null
+++ b/src/tools/lucene-cli/Program.cs
@@ -0,0 +1,35 @@
+using System;
+
+namespace Lucene.Net.Cli
+{
+    /*
+     * Licensed to the Apache Software Foundation (ASF) under one or more
+     * contributor license agreements.  See the NOTICE file distributed with
+     * this work for additional information regarding copyright ownership.
+     * The ASF licenses this file to You under the Apache License, Version 2.0
+     * (the "License"); you may not use this file except in compliance with
+     * the License.  You may obtain a copy of the License at
+     *
+     *     http://www.apache.org/licenses/LICENSE-2.0
+     *
+     * Unless required by applicable law or agreed to in writing, software
+     * distributed under the License is distributed on an "AS IS" BASIS,
+     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     * See the License for the specific language governing permissions and
+     * limitations under the License.
+     */
+
+    public class Program
+    {
+        public static int Main(string[] args)
+        {
+            int result = CommandLineOptions.Parse(args);
+
+#if DEBUG
+            Console.ReadKey();
+#endif
+
+            return result;
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/9e389540/src/tools/lucene-cli/Properties/AssemblyInfo.cs
----------------------------------------------------------------------
diff --git a/src/tools/lucene-cli/Properties/AssemblyInfo.cs b/src/tools/lucene-cli/Properties/AssemblyInfo.cs
new file mode 100644
index 0000000..07a71d6
--- /dev/null
+++ b/src/tools/lucene-cli/Properties/AssemblyInfo.cs
@@ -0,0 +1,37 @@
+/*
+* Licensed to the Apache Software Foundation (ASF) under one or more
+* contributor license agreements.  See the NOTICE file distributed with
+* this work for additional information regarding copyright ownership.
+* The ASF licenses this file to You under the Apache License, Version 2.0
+* (the "License"); you may not use this file except in compliance with
+* the License.  You may obtain a copy of the License at
+*
+*     http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("lucene-cli")]
+[assembly: AssemblyDescription(
+    "Lucene.Net maintenance utilities and demos.")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyDefaultAlias("Lucene.Net.Cli")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components.  If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("d5f3414e-e743-4dca-a50a-da3278a2ba2b")]

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/9e389540/src/tools/lucene-cli/Properties/launchSettings.json
----------------------------------------------------------------------
diff --git a/src/tools/lucene-cli/Properties/launchSettings.json b/src/tools/lucene-cli/Properties/launchSettings.json
new file mode 100644
index 0000000..1c0ef57
--- /dev/null
+++ b/src/tools/lucene-cli/Properties/launchSettings.json
@@ -0,0 +1,7 @@
+{
+  "profiles": {
+    "lucene-cli": {
+      "commandName": "Project"
+    }
+  }
+}
\ No newline at end of file


[03/22] lucenenet git commit: Added lucene-cli + tests - a wrapper console application so we can run the various utilities and demos in .NET on the command line.

Posted by ni...@apache.org.
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/9e389540/src/tools/lucene-cli/Resources/Strings.Designer.cs
----------------------------------------------------------------------
diff --git a/src/tools/lucene-cli/Resources/Strings.Designer.cs b/src/tools/lucene-cli/Resources/Strings.Designer.cs
new file mode 100644
index 0000000..0db885c
--- /dev/null
+++ b/src/tools/lucene-cli/Resources/Strings.Designer.cs
@@ -0,0 +1,962 @@
+//------------------------------------------------------------------------------
+// <auto-generated>
+//     This code was generated by a tool.
+//     Runtime Version:4.0.30319.42000
+//
+//     Changes to this file may cause incorrect behavior and will be lost if
+//     the code is regenerated.
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+namespace Lucene.Net.Cli.Resources {
+    using System;
+    using System.Reflection;
+    
+    
+    /// <summary>
+    ///    A strongly-typed resource class, for looking up localized strings, etc.
+    /// </summary>
+    // This class was auto-generated by the StronglyTypedResourceBuilder
+    // class via a tool like ResGen or Visual Studio.
+    // To add or remove a member, edit your .ResX file then rerun ResGen
+    // with the /str option, or rebuild your VS project.
+    [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+    public class Strings {
+        
+        private static global::System.Resources.ResourceManager resourceMan;
+        
+        private static global::System.Globalization.CultureInfo resourceCulture;
+        
+        internal Strings() {
+        }
+        
+        /// <summary>
+        ///    Returns the cached ResourceManager instance used by this class.
+        /// </summary>
+        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+        public static global::System.Resources.ResourceManager ResourceManager {
+            get {
+                if (object.ReferenceEquals(resourceMan, null)) {
+                    global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("lucene-cli.Resources.Strings", typeof(Strings).GetTypeInfo().Assembly);
+                    resourceMan = temp;
+                }
+                return resourceMan;
+            }
+        }
+        
+        /// <summary>
+        ///    Overrides the current thread's CurrentUICulture property for all
+        ///    resource lookups using this strongly typed resource class.
+        /// </summary>
+        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+        public static global::System.Globalization.CultureInfo Culture {
+            get {
+                return resourceCulture;
+            }
+            set {
+                resourceCulture = value;
+            }
+        }
+        
+        /// <summary>
+        ///    Looks up a localized string similar to Utilities to manage specialized analyzers..
+        /// </summary>
+        public static string AnalysisCommandDescription {
+            get {
+                return ResourceManager.GetString("AnalysisCommandDescription", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///    Looks up a localized string similar to Compiles a stemmer table for the Egothor stemmer..
+        /// </summary>
+        public static string AnalysisStempelCompileStemsCommandDescription {
+            get {
+                return ResourceManager.GetString("AnalysisStempelCompileStemsCommandDescription", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///    Looks up a localized string similar to The path to a file containing a stemmer table. Multiple values are allowed..
+        /// </summary>
+        public static string AnalysisStempelCompileStemsCommandStemmerTableFilesDescription {
+            get {
+                return ResourceManager.GetString("AnalysisStempelCompileStemsCommandStemmerTableFilesDescription", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///    Looks up a localized string similar to The encoding to use for the stemmer table files..
+        /// </summary>
+        public static string AnalysisStempelCompileStemsCommandStemmerTableFilesEncodingDescription {
+            get {
+                return ResourceManager.GetString("AnalysisStempelCompileStemsCommandStemmerTableFilesEncodingDescription", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///    Looks up a localized string similar to The name of the desired stemming algorithm to use..
+        /// </summary>
+        public static string AnalysisStempelCompileStemsCommandStemmingAlgorithmDescription {
+            get {
+                return ResourceManager.GetString("AnalysisStempelCompileStemsCommandStemmingAlgorithmDescription", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///    Looks up a localized string similar to Generates patch commands from an already prepared stemmer table..
+        /// </summary>
+        public static string AnalysisStempelPatchStemsCommandDescription {
+            get {
+                return ResourceManager.GetString("AnalysisStempelPatchStemsCommandDescription", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///    Looks up a localized string similar to The path to a file containing a stemmer table. Multiple values are allowed..
+        /// </summary>
+        public static string AnalysisStempelPatchStemsCommandStemmerTableFilesDescription {
+            get {
+                return ResourceManager.GetString("AnalysisStempelPatchStemsCommandStemmerTableFilesDescription", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///    Looks up a localized string similar to The encoding to use for the stemmer table files..
+        /// </summary>
+        public static string AnalysisStempelPatchStemsCommandStemmerTableFilesEncodingDescription {
+            get {
+                return ResourceManager.GetString("AnalysisStempelPatchStemsCommandStemmerTableFilesEncodingDescription", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///    Looks up a localized string similar to Cross check term vectors..
+        /// </summary>
+        public static string CrossCheckTermVectorsDescription {
+            get {
+                return ResourceManager.GetString("CrossCheckTermVectorsDescription", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///    Looks up a localized string similar to Shows example usage of category associations..
+        /// </summary>
+        public static string DemoAssociationsFacetsCommandDescription {
+            get {
+                return ResourceManager.GetString("DemoAssociationsFacetsCommandDescription", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///    Looks up a localized string similar to Demos for various Lucene.Net functionality including C# code samples..
+        /// </summary>
+        public static string DemoCommandDescription {
+            get {
+                return ResourceManager.GetString("DemoCommandDescription", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///    Looks up a localized string similar to Shows simple usage of dynamic range faceting, using the expressions module to calculate distance..
+        /// </summary>
+        public static string DemoDistanceFacetsCommandDescription {
+            get {
+                return ResourceManager.GetString("DemoDistanceFacetsCommandDescription", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///    Looks up a localized string similar to Shows facets aggregation by an expression..
+        /// </summary>
+        public static string DemoExpressionAggregationFacetsCommandDescription {
+            get {
+                return ResourceManager.GetString("DemoExpressionAggregationFacetsCommandDescription", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///    Looks up a localized string similar to Index all text files under a directory..
+        /// </summary>
+        public static string DemoIndexFilesCommandDescription {
+            get {
+                return ResourceManager.GetString("DemoIndexFilesCommandDescription", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///    Looks up a localized string similar to This demo can be used to learn how to build a Lucene.Net index. After the index is built, you can run the search-files demo to run queries against it..
+        /// </summary>
+        public static string DemoIndexFilesCommandExtendedHelpText {
+            get {
+                return ResourceManager.GetString("DemoIndexFilesCommandExtendedHelpText", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///    Looks up a localized string similar to The source directory containing files to index. This operation is recursive..
+        /// </summary>
+        public static string DemoIndexFilesCommandSourceDirectoryDescription {
+            get {
+                return ResourceManager.GetString("DemoIndexFilesCommandSourceDirectoryDescription", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///    Looks up a localized string similar to Adds new documents to an existing index. If not supplied, any existing index in the &lt;INDEX_DIRECTORY&gt; will be overwritten..
+        /// </summary>
+        public static string DemoIndexFilesCommandUpdateDescription {
+            get {
+                return ResourceManager.GetString("DemoIndexFilesCommandUpdateDescription", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///    Looks up a localized string similar to Demonstrates indexing categories into different indexed fields..
+        /// </summary>
+        public static string DemoMultiCategoryListsFacetsCommandDescription {
+            get {
+                return ResourceManager.GetString("DemoMultiCategoryListsFacetsCommandDescription", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///    Looks up a localized string similar to Shows simple usage of dynamic range faceting..
+        /// </summary>
+        public static string DemoRangeFacetsCommandDescription {
+            get {
+                return ResourceManager.GetString("DemoRangeFacetsCommandDescription", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///    Looks up a localized string similar to Simple command-line based search demo. Run index-files demo first..
+        /// </summary>
+        public static string DemoSearchFilesCommandDescription {
+            get {
+                return ResourceManager.GetString("DemoSearchFilesCommandDescription", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///    Looks up a localized string similar to Run the index-files demo first to create an index to run this command against. You can either use a file containing many queries, a single query on the command line, or omit both options to run queries interactively..
+        /// </summary>
+        public static string DemoSearchFilesCommandExtendedHelpText {
+            get {
+                return ResourceManager.GetString("DemoSearchFilesCommandExtendedHelpText", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///    Looks up a localized string similar to The index field to use in the search..
+        /// </summary>
+        public static string DemoSearchFilesCommandFieldDescription {
+            get {
+                return ResourceManager.GetString("DemoSearchFilesCommandFieldDescription", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///    Looks up a localized string similar to Hits per page to display..
+        /// </summary>
+        public static string DemoSearchFilesCommandPageSizeDescription {
+            get {
+                return ResourceManager.GetString("DemoSearchFilesCommandPageSizeDescription", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///    Looks up a localized string similar to A file containing the queries to perform..
+        /// </summary>
+        public static string DemoSearchFilesCommandQueriesFileDescription {
+            get {
+                return ResourceManager.GetString("DemoSearchFilesCommandQueriesFileDescription", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///    Looks up a localized string similar to A query to perform..
+        /// </summary>
+        public static string DemoSearchFilesCommandQueryDescription {
+            get {
+                return ResourceManager.GetString("DemoSearchFilesCommandQueryDescription", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///    Looks up a localized string similar to Output raw format..
+        /// </summary>
+        public static string DemoSearchFilesCommandRawDescription {
+            get {
+                return ResourceManager.GetString("DemoSearchFilesCommandRawDescription", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///    Looks up a localized string similar to Repeat the search and time as a benchmark..
+        /// </summary>
+        public static string DemoSearchFilesCommandRepeatDescription {
+            get {
+                return ResourceManager.GetString("DemoSearchFilesCommandRepeatDescription", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///    Looks up a localized string similar to Shows simple usage of faceted indexing and search..
+        /// </summary>
+        public static string DemoSimpleFacetsCommandDescription {
+            get {
+                return ResourceManager.GetString("DemoSimpleFacetsCommandDescription", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///    Looks up a localized string similar to Shows simple usage of faceted indexing and search using SortedSetDocValuesFacetField and SortedSetDocValuesFacetCounts..
+        /// </summary>
+        public static string DemoSimpleSortedSetFacetsCommandDescription {
+            get {
+                return ResourceManager.GetString("DemoSimpleSortedSetFacetsCommandDescription", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///    Looks up a localized string similar to The FSDirectory implementation to use. Defaults to the optimal FSDirectory for your OS platform..
+        /// </summary>
+        public static string DirectoryTypeOptionDescription {
+            get {
+                return ResourceManager.GetString("DirectoryTypeOptionDescription", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///    Looks up a localized string similar to Source code exported to &apos;{0}&apos;..
+        /// </summary>
+        public static string ExportingSourceCodeCompleteMessage {
+            get {
+                return ResourceManager.GetString("ExportingSourceCodeCompleteMessage", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///    Looks up a localized string similar to Exporting source code....
+        /// </summary>
+        public static string ExportingSourceCodeMessage {
+            get {
+                return ResourceManager.GetString("ExportingSourceCodeMessage", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///    Looks up a localized string similar to An error occurred:.
+        /// </summary>
+        public static string GeneralExceptionMessage {
+            get {
+                return ResourceManager.GetString("GeneralExceptionMessage", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///    Looks up a localized string similar to Specify --help for a list of available options and commands..
+        /// </summary>
+        public static string HelpCommandsMessage {
+            get {
+                return ResourceManager.GetString("HelpCommandsMessage", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///    Looks up a localized string similar to Checks an index for problematic segments..
+        /// </summary>
+        public static string IndexCheckCommandDescription {
+            get {
+                return ResourceManager.GetString("IndexCheckCommandDescription", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///    Looks up a localized string similar to Only check the specified segment(s). This can be specified multiple times, to check more than one segment, eg --segment _2 --segment _a..
+        /// </summary>
+        public static string IndexCheckCommandSegmentsDescription {
+            get {
+                return ResourceManager.GetString("IndexCheckCommandSegmentsDescription", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///    Looks up a localized string similar to Utilities to analyze or maintain an index..
+        /// </summary>
+        public static string IndexCommandDescription {
+            get {
+                return ResourceManager.GetString("IndexCommandDescription", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///    Looks up a localized string similar to Copies segments from one index to another index..
+        /// </summary>
+        public static string IndexCopySegmentsCommandDescription {
+            get {
+                return ResourceManager.GetString("IndexCopySegmentsCommandDescription", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///    Looks up a localized string similar to This tool does file-level copying of segments files. This means it&apos;s unable to split apart a single segment into multiple segments. For example if your index is a single segment, this tool won&apos;t help. Also, it does basic file-level copying (using a simple FileStream) so it will not work with non FSDirectory Directory implementations..
+        /// </summary>
+        public static string IndexCopySegmentsCommandExtendedHelpText {
+            get {
+                return ResourceManager.GetString("IndexCopySegmentsCommandExtendedHelpText", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///    Looks up a localized string similar to The directory of the index to copy..
+        /// </summary>
+        public static string IndexCopySegmentsCommandInputDirectoryDescription {
+            get {
+                return ResourceManager.GetString("IndexCopySegmentsCommandInputDirectoryDescription", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///    Looks up a localized string similar to The directory of the destination index..
+        /// </summary>
+        public static string IndexCopySegmentsCommandOutputDirectoryDescription {
+            get {
+                return ResourceManager.GetString("IndexCopySegmentsCommandOutputDirectoryDescription", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///    Looks up a localized string similar to The segments to copy, separated by a space..
+        /// </summary>
+        public static string IndexCopySegmentsCommandSegmentsDescription {
+            get {
+                return ResourceManager.GetString("IndexCopySegmentsCommandSegmentsDescription", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///    Looks up a localized string similar to Deletes segments from an index..
+        /// </summary>
+        public static string IndexDeleteSegmentsCommandDescription {
+            get {
+                return ResourceManager.GetString("IndexDeleteSegmentsCommandDescription", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///    Looks up a localized string similar to You can easily accidentally remove segments from your index so be careful! Always make a backup of your index first..
+        /// </summary>
+        public static string IndexDeleteSegmentsCommandExtendedHelpText {
+            get {
+                return ResourceManager.GetString("IndexDeleteSegmentsCommandExtendedHelpText", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///    Looks up a localized string similar to The segments to delete, separated by a space..
+        /// </summary>
+        public static string IndexDeleteSegmentsCommandSegmentsDescription {
+            get {
+                return ResourceManager.GetString("IndexDeleteSegmentsCommandSegmentsDescription", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///    Looks up a localized string similar to The directory of the index..
+        /// </summary>
+        public static string IndexDirectoryArgumentDescription {
+            get {
+                return ResourceManager.GetString("IndexDirectoryArgumentDescription", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///    Looks up a localized string similar to If omitted, it defaults to the current working directory..
+        /// </summary>
+        public static string IndexDirectoryOptionalArgumentDescription {
+            get {
+                return ResourceManager.GetString("IndexDirectoryOptionalArgumentDescription", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///    Looks up a localized string similar to The .cfs file containing words to parse..
+        /// </summary>
+        public static string IndexExtractCfsCommandCFSFileNameDescription {
+            get {
+                return ResourceManager.GetString("IndexExtractCfsCommandCFSFileNameDescription", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///    Looks up a localized string similar to Lists sub-files from a .cfs compound file..
+        /// </summary>
+        public static string IndexExtractCfsCommandDescription {
+            get {
+                return ResourceManager.GetString("IndexExtractCfsCommandDescription", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///    Looks up a localized string similar to The .cfs compound file format is created using the CompoundFileDirectory from Lucene.Net.Misc..
+        /// </summary>
+        public static string IndexExtractCfsCommandExtendedHelpText {
+            get {
+                return ResourceManager.GetString("IndexExtractCfsCommandExtendedHelpText", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///    Looks up a localized string similar to Fixes an index with problematic segments..
+        /// </summary>
+        public static string IndexFixCommandDescription {
+            get {
+                return ResourceManager.GetString("IndexFixCommandDescription", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///    Looks up a localized string similar to The .cfs file containing words to parse..
+        /// </summary>
+        public static string IndexListCfsCommandCFSFileNameDescription {
+            get {
+                return ResourceManager.GetString("IndexListCfsCommandCFSFileNameDescription", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///    Looks up a localized string similar to Extracts sub-files out of a .cfs compound file..
+        /// </summary>
+        public static string IndexListCfsCommandDescription {
+            get {
+                return ResourceManager.GetString("IndexListCfsCommandDescription", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///    Looks up a localized string similar to The .cfs compound file format is created using the CompoundFileDirectory from Lucene.Net.Misc..
+        /// </summary>
+        public static string IndexListCfsCommandExtendedHelpText {
+            get {
+                return ResourceManager.GetString("IndexListCfsCommandExtendedHelpText", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///    Looks up a localized string similar to Extracts the top n most frequent terms by document frequency..
+        /// </summary>
+        public static string IndexListHighFreqTermsCommandDescription {
+            get {
+                return ResourceManager.GetString("IndexListHighFreqTermsCommandDescription", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///    Looks up a localized string similar to Extracts the top n most frequent terms (by document frequency) from an index and reports thier document frequency..
+        /// </summary>
+        public static string IndexListHighFreqTermsCommandExtendedHelpText {
+            get {
+                return ResourceManager.GetString("IndexListHighFreqTermsCommandExtendedHelpText", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///    Looks up a localized string similar to The field to consider. If omitted, considers all fields..
+        /// </summary>
+        public static string IndexListHighFreqTermsCommandFieldDescription {
+            get {
+                return ResourceManager.GetString("IndexListHighFreqTermsCommandFieldDescription", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///    Looks up a localized string similar to The number of terms to consider. If omitted, defaults to 100..
+        /// </summary>
+        public static string IndexListHighFreqTermsCommandNumberOfTermsDescription {
+            get {
+                return ResourceManager.GetString("IndexListHighFreqTermsCommandNumberOfTermsDescription", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///    Looks up a localized string similar to Specifies that both the document frequency &amp; term frequency are reported, ordered by descending total term frequency..
+        /// </summary>
+        public static string IndexListHighFreqTermsCommandTotalTermFrequencyDescription {
+            get {
+                return ResourceManager.GetString("IndexListHighFreqTermsCommandTotalTermFrequencyDescription", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///    Looks up a localized string similar to Lists segments in an index..
+        /// </summary>
+        public static string IndexListSegmentsCommandDescription {
+            get {
+                return ResourceManager.GetString("IndexListSegmentsCommandDescription", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///    Looks up a localized string similar to Displays the taxonomy statistical information for a taxonomy index..
+        /// </summary>
+        public static string IndexListTaxonomyStatsDescription {
+            get {
+                return ResourceManager.GetString("IndexListTaxonomyStatsDescription", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///    Looks up a localized string similar to Recursively lists all descendent nodes..
+        /// </summary>
+        public static string IndexListTaxonomyStatsShowTreeDescription {
+            get {
+                return ResourceManager.GetString("IndexListTaxonomyStatsShowTreeDescription", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///    Looks up a localized string similar to Gets document frequency and total number of occurrences of a term..
+        /// </summary>
+        public static string IndexListTermInfoCommandDescription {
+            get {
+                return ResourceManager.GetString("IndexListTermInfoCommandDescription", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///    Looks up a localized string similar to Gets document frequency and total number of occurrences (sum of the term frequency for each document) of a term..
+        /// </summary>
+        public static string IndexListTermInfoCommandExtendedHelpText {
+            get {
+                return ResourceManager.GetString("IndexListTermInfoCommandExtendedHelpText", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///    Looks up a localized string similar to The field to consider..
+        /// </summary>
+        public static string IndexListTermInfoCommandFieldDescription {
+            get {
+                return ResourceManager.GetString("IndexListTermInfoCommandFieldDescription", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///    Looks up a localized string similar to The directory of the index..
+        /// </summary>
+        public static string IndexListTermInfoCommandIndexDirectoryDescription {
+            get {
+                return ResourceManager.GetString("IndexListTermInfoCommandIndexDirectoryDescription", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///    Looks up a localized string similar to The term to consider..
+        /// </summary>
+        public static string IndexListTermInfoCommandTermDescription {
+            get {
+                return ResourceManager.GetString("IndexListTermInfoCommandTermDescription", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///    Looks up a localized string similar to Merges multiple indexes into a single index..
+        /// </summary>
+        public static string IndexMergeCommandDescription {
+            get {
+                return ResourceManager.GetString("IndexMergeCommandDescription", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///    Looks up a localized string similar to Two or more source index directories separated by a space..
+        /// </summary>
+        public static string IndexMergeCommandInputDirectoryDescription {
+            get {
+                return ResourceManager.GetString("IndexMergeCommandInputDirectoryDescription", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///    Looks up a localized string similar to Output directory to merge the indexes into..
+        /// </summary>
+        public static string IndexMergeCommandOutputDirectoryDescription {
+            get {
+                return ResourceManager.GetString("IndexMergeCommandOutputDirectoryDescription", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///    Looks up a localized string similar to Splits an index into multiple parts..
+        /// </summary>
+        public static string IndexSplitCommandDescription {
+            get {
+                return ResourceManager.GetString("IndexSplitCommandDescription", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///    Looks up a localized string similar to Path to input index. Multiple values can be provided separated by a space..
+        /// </summary>
+        public static string IndexSplitCommandInputDirectoryDescription {
+            get {
+                return ResourceManager.GetString("IndexSplitCommandInputDirectoryDescription", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///    Looks up a localized string similar to The number of parts to produce..
+        /// </summary>
+        public static string IndexSplitCommandNumberOfPartsDescription {
+            get {
+                return ResourceManager.GetString("IndexSplitCommandNumberOfPartsDescription", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///    Looks up a localized string similar to Path to output directory to contain partial indexes..
+        /// </summary>
+        public static string IndexSplitCommandOutputDirectoryDescription {
+            get {
+                return ResourceManager.GetString("IndexSplitCommandOutputDirectoryDescription", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///    Looks up a localized string similar to Sequential docid-range split..
+        /// </summary>
+        public static string IndexSplitCommandSequentialDescription {
+            get {
+                return ResourceManager.GetString("IndexSplitCommandSequentialDescription", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///    Looks up a localized string similar to Deletes prior commits..
+        /// </summary>
+        public static string IndexUpgradeCommandDeleteDescription {
+            get {
+                return ResourceManager.GetString("IndexUpgradeCommandDeleteDescription", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///    Looks up a localized string similar to Upgrades all segments of an index from previous Lucene.Net versions to the current segment file format..
+        /// </summary>
+        public static string IndexUpgradeCommandDescription {
+            get {
+                return ResourceManager.GetString("IndexUpgradeCommandDescription", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///    Looks up a localized string similar to  This tool keeps only the last commit in an index; for this reason, if the incoming index has more than one commit, the tool refuses to run by default. Specify --delete-prior-commits to override this, allowing the tool to delete all but the last commit. Specify an FSDirectory implementation through the --directory-type option to force its use. If not qualified by an AssemblyName, the Lucene.Net.dll assembly will be used. WARNING: This tool may reorder document IDs! Also, ensure you are using the correct vers [rest of string was truncated]&quot;;.
+        /// </summary>
+        public static string IndexUpgradeCommandExtendedHelpText {
+            get {
+                return ResourceManager.GetString("IndexUpgradeCommandExtendedHelpText", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///    Looks up a localized string similar to Utilities for verifying concurrent locking integrity..
+        /// </summary>
+        public static string LockCommandDescription {
+            get {
+                return ResourceManager.GetString("LockCommandDescription", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///    Looks up a localized string similar to Number of locking tries..
+        /// </summary>
+        public static string LockStressTestCommandCountDescription {
+            get {
+                return ResourceManager.GetString("LockStressTestCommandCountDescription", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///    Looks up a localized string similar to Simple standalone tool that forever acquires &amp; releases a lock using a specific LockFactory..
+        /// </summary>
+        public static string LockStressTestCommandDescription {
+            get {
+                return ResourceManager.GetString("LockStressTestCommandDescription", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///    Looks up a localized string similar to You should run multiple instances of this process, each with its own unique ID, and each pointing to the same lock directory, to verify that locking is working correctly. Make sure you are first running LockVerifyServer..
+        /// </summary>
+        public static string LockStressTestCommandExtendedHelpText {
+            get {
+                return ResourceManager.GetString("LockStressTestCommandExtendedHelpText", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///    Looks up a localized string similar to int value from 0 .. 255 (should be unique for test process)..
+        /// </summary>
+        public static string LockStressTestCommandIDDescription {
+            get {
+                return ResourceManager.GetString("LockStressTestCommandIDDescription", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///    Looks up a localized string similar to Path to the lock directory (only set for Simple/NativeFSLockFactory)..
+        /// </summary>
+        public static string LockStressTestCommandLockFactoryNameDescription {
+            get {
+                return ResourceManager.GetString("LockStressTestCommandLockFactoryNameDescription", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///    Looks up a localized string similar to Primary LockFactory class that we will use..
+        /// </summary>
+        public static string LockStressTestCommandLockFactoryTypeNameDescription {
+            get {
+                return ResourceManager.GetString("LockStressTestCommandLockFactoryTypeNameDescription", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///    Looks up a localized string similar to Milliseconds to pause betweeen each lock obtain/release..
+        /// </summary>
+        public static string LockStressTestCommandSleepTimeMSDescription {
+            get {
+                return ResourceManager.GetString("LockStressTestCommandSleepTimeMSDescription", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///    Looks up a localized string similar to Port that LockVerifyServer is listening on..
+        /// </summary>
+        public static string LockStressTestCommandVerfierPortDescription {
+            get {
+                return ResourceManager.GetString("LockStressTestCommandVerfierPortDescription", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///    Looks up a localized string similar to Hostname that LockVerifyServer is listening on..
+        /// </summary>
+        public static string LockStressTestCommandVerifierHostDescription {
+            get {
+                return ResourceManager.GetString("LockStressTestCommandVerifierHostDescription", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///    Looks up a localized string similar to Simple standalone server that must be running when you use VerifyingLockFactory. This server verifies at most one process holds the lock at a time..
+        /// </summary>
+        public static string LockVerifyServerCommandDescription {
+            get {
+                return ResourceManager.GetString("LockVerifyServerCommandDescription", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///    Looks up a localized string similar to Hostname or IP address that LockVerifyServer will listen on..
+        /// </summary>
+        public static string LockVerifyServerCommandIPHostnameDescription {
+            get {
+                return ResourceManager.GetString("LockVerifyServerCommandIPHostnameDescription", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///    Looks up a localized string similar to The maximum number of concurrent clients..
+        /// </summary>
+        public static string LockVerifyServerCommandMaxClientsDescription {
+            get {
+                return ResourceManager.GetString("LockVerifyServerCommandMaxClientsDescription", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///    Looks up a localized string similar to {0} arguments are required..
+        /// </summary>
+        public static string NotEnoughArguments {
+            get {
+                return ResourceManager.GetString("NotEnoughArguments", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///    Looks up a localized string similar to Output the source code of the demo to the specified directory..
+        /// </summary>
+        public static string OutputSourceCodeDescription {
+            get {
+                return ResourceManager.GetString("OutputSourceCodeDescription", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///    Looks up a localized string similar to Run &apos;demo {0} --view-source-code&apos; to see the C# code or &apos;demo {0} --output-source-code &lt;DIRECTORY&gt;&apos; to export the code to a local directory..
+        /// </summary>
+        public static string OutputSourceCodeMessage {
+            get {
+                return ResourceManager.GetString("OutputSourceCodeMessage", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///    Looks up a localized string similar to Utilities and demos for Lucene.Net..
+        /// </summary>
+        public static string RootCommandDescription {
+            get {
+                return ResourceManager.GetString("RootCommandDescription", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///    Looks up a localized string similar to One or more segments, separated by a space..
+        /// </summary>
+        public static string SegmentsArgumentDescription {
+            get {
+                return ResourceManager.GetString("SegmentsArgumentDescription", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///    Looks up a localized string similar to An index segment..
+        /// </summary>
+        public static string SegmentsOptionDescription {
+            get {
+                return ResourceManager.GetString("SegmentsOptionDescription", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///    Looks up a localized string similar to Multiple segments are allowed..
+        /// </summary>
+        public static string SegmentsOptionMultipleDescription {
+            get {
+                return ResourceManager.GetString("SegmentsOptionMultipleDescription", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///    Looks up a localized string similar to Verbose output..
+        /// </summary>
+        public static string VerboseOptionDescription {
+            get {
+                return ResourceManager.GetString("VerboseOptionDescription", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///    Looks up a localized string similar to View the source code of the demo..
+        /// </summary>
+        public static string ViewSourceCodeDescription {
+            get {
+                return ResourceManager.GetString("ViewSourceCodeDescription", resourceCulture);
+            }
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/9e389540/src/tools/lucene-cli/Resources/Strings.resx
----------------------------------------------------------------------
diff --git a/src/tools/lucene-cli/Resources/Strings.resx b/src/tools/lucene-cli/Resources/Strings.resx
new file mode 100644
index 0000000..3634369
--- /dev/null
+++ b/src/tools/lucene-cli/Resources/Strings.resx
@@ -0,0 +1,420 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+  <!-- 
+    Microsoft ResX Schema 
+    
+    Version 2.0
+    
+    The primary goals of this format is to allow a simple XML format 
+    that is mostly human readable. The generation and parsing of the 
+    various data types are done through the TypeConverter classes 
+    associated with the data types.
+    
+    Example:
+    
+    ... ado.net/XML headers & schema ...
+    <resheader name="resmimetype">text/microsoft-resx</resheader>
+    <resheader name="version">2.0</resheader>
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+        <value>[base64 mime encoded serialized .NET Framework object]</value>
+    </data>
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+        <comment>This is a comment</comment>
+    </data>
+                
+    There are any number of "resheader" rows that contain simple 
+    name/value pairs.
+    
+    Each data row contains a name, and value. The row also contains a 
+    type or mimetype. Type corresponds to a .NET class that support 
+    text/value conversion through the TypeConverter architecture. 
+    Classes that don't support this are serialized and stored with the 
+    mimetype set.
+    
+    The mimetype is used for serialized objects, and tells the 
+    ResXResourceReader how to depersist the object. This is currently not 
+    extensible. For a given mimetype the value must be set accordingly:
+    
+    Note - application/x-microsoft.net.object.binary.base64 is the format 
+    that the ResXResourceWriter will generate, however the reader can 
+    read any of the formats listed below.
+    
+    mimetype: application/x-microsoft.net.object.binary.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+            : and then encoded with base64 encoding.
+    
+    mimetype: application/x-microsoft.net.object.soap.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+            : and then encoded with base64 encoding.
+
+    mimetype: application/x-microsoft.net.object.bytearray.base64
+    value   : The object must be serialized into a byte array 
+            : using a System.ComponentModel.TypeConverter
+            : and then encoded with base64 encoding.
+    -->
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+    <xsd:element name="root" msdata:IsDataSet="true">
+      <xsd:complexType>
+        <xsd:choice maxOccurs="unbounded">
+          <xsd:element name="metadata">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" />
+              </xsd:sequence>
+              <xsd:attribute name="name" use="required" type="xsd:string" />
+              <xsd:attribute name="type" type="xsd:string" />
+              <xsd:attribute name="mimetype" type="xsd:string" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="assembly">
+            <xsd:complexType>
+              <xsd:attribute name="alias" type="xsd:string" />
+              <xsd:attribute name="name" type="xsd:string" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="data">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="resheader">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" />
+            </xsd:complexType>
+          </xsd:element>
+        </xsd:choice>
+      </xsd:complexType>
+    </xsd:element>
+  </xsd:schema>
+  <resheader name="resmimetype">
+    <value>text/microsoft-resx</value>
+  </resheader>
+  <resheader name="version">
+    <value>2.0</value>
+  </resheader>
+  <resheader name="reader">
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <resheader name="writer">
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <data name="AnalysisCommandDescription" xml:space="preserve">
+    <value>Utilities to manage specialized analyzers.</value>
+  </data>
+  <data name="AnalysisStempelCompileStemsCommandDescription" xml:space="preserve">
+    <value>Compiles a stemmer table for the Egothor stemmer.</value>
+  </data>
+  <data name="AnalysisStempelCompileStemsCommandStemmerTableFilesDescription" xml:space="preserve">
+    <value>The path to a file containing a stemmer table. Multiple values are allowed.</value>
+  </data>
+  <data name="AnalysisStempelCompileStemsCommandStemmerTableFilesEncodingDescription" xml:space="preserve">
+    <value>The encoding to use for the stemmer table files.</value>
+  </data>
+  <data name="AnalysisStempelCompileStemsCommandStemmingAlgorithmDescription" xml:space="preserve">
+    <value>The name of the desired stemming algorithm to use.</value>
+  </data>
+  <data name="AnalysisStempelPatchStemsCommandDescription" xml:space="preserve">
+    <value>Generates patch commands from an already prepared stemmer table.</value>
+  </data>
+  <data name="AnalysisStempelPatchStemsCommandStemmerTableFilesDescription" xml:space="preserve">
+    <value>The path to a file containing a stemmer table. Multiple values are allowed.</value>
+  </data>
+  <data name="AnalysisStempelPatchStemsCommandStemmerTableFilesEncodingDescription" xml:space="preserve">
+    <value>The encoding to use for the stemmer table files.</value>
+  </data>
+  <data name="CrossCheckTermVectorsDescription" xml:space="preserve">
+    <value>Cross check term vectors.</value>
+  </data>
+  <data name="DemoAssociationsFacetsCommandDescription" xml:space="preserve">
+    <value>Shows example usage of category associations.</value>
+  </data>
+  <data name="DemoCommandDescription" xml:space="preserve">
+    <value>Demos for various Lucene.Net functionality including C# code samples.</value>
+  </data>
+  <data name="DemoDistanceFacetsCommandDescription" xml:space="preserve">
+    <value>Shows simple usage of dynamic range faceting, using the expressions module to calculate distance.</value>
+  </data>
+  <data name="DemoExpressionAggregationFacetsCommandDescription" xml:space="preserve">
+    <value>Shows facets aggregation by an expression.</value>
+  </data>
+  <data name="DemoIndexFilesCommandDescription" xml:space="preserve">
+    <value>Index all text files under a directory.</value>
+  </data>
+  <data name="DemoIndexFilesCommandExtendedHelpText" xml:space="preserve">
+    <value>This demo can be used to learn how to build a Lucene.Net index. After the index is built, you can run the search-files demo to run queries against it.</value>
+  </data>
+  <data name="DemoIndexFilesCommandSourceDirectoryDescription" xml:space="preserve">
+    <value>The source directory containing files to index. This operation is recursive.</value>
+  </data>
+  <data name="DemoIndexFilesCommandUpdateDescription" xml:space="preserve">
+    <value>Adds new documents to an existing index. If not supplied, any existing index in the &lt;INDEX_DIRECTORY&gt; will be overwritten.</value>
+  </data>
+  <data name="DemoMultiCategoryListsFacetsCommandDescription" xml:space="preserve">
+    <value>Demonstrates indexing categories into different indexed fields.</value>
+  </data>
+  <data name="DemoRangeFacetsCommandDescription" xml:space="preserve">
+    <value>Shows simple usage of dynamic range faceting.</value>
+  </data>
+  <data name="DemoSearchFilesCommandDescription" xml:space="preserve">
+    <value>Simple command-line based search demo. Run index-files demo first.</value>
+  </data>
+  <data name="DemoSearchFilesCommandExtendedHelpText" xml:space="preserve">
+    <value>Run the index-files demo first to create an index to run this command against. You can either use a file containing many queries, a single query on the command line, or omit both options to run queries interactively.</value>
+  </data>
+  <data name="DemoSearchFilesCommandFieldDescription" xml:space="preserve">
+    <value>The index field to use in the search.</value>
+  </data>
+  <data name="DemoSearchFilesCommandPageSizeDescription" xml:space="preserve">
+    <value>Hits per page to display.</value>
+  </data>
+  <data name="DemoSearchFilesCommandQueriesFileDescription" xml:space="preserve">
+    <value>A file containing the queries to perform.</value>
+  </data>
+  <data name="DemoSearchFilesCommandQueryDescription" xml:space="preserve">
+    <value>A query to perform.</value>
+  </data>
+  <data name="DemoSearchFilesCommandRawDescription" xml:space="preserve">
+    <value>Output raw format.</value>
+  </data>
+  <data name="DemoSearchFilesCommandRepeatDescription" xml:space="preserve">
+    <value>Repeat the search and time as a benchmark.</value>
+  </data>
+  <data name="DemoSimpleFacetsCommandDescription" xml:space="preserve">
+    <value>Shows simple usage of faceted indexing and search.</value>
+  </data>
+  <data name="DemoSimpleSortedSetFacetsCommandDescription" xml:space="preserve">
+    <value>Shows simple usage of faceted indexing and search using SortedSetDocValuesFacetField and SortedSetDocValuesFacetCounts.</value>
+  </data>
+  <data name="DirectoryTypeOptionDescription" xml:space="preserve">
+    <value>The FSDirectory implementation to use. Defaults to the optimal FSDirectory for your OS platform.</value>
+  </data>
+  <data name="ExportingSourceCodeCompleteMessage" xml:space="preserve">
+    <value>Source code exported to '{0}'.</value>
+  </data>
+  <data name="ExportingSourceCodeMessage" xml:space="preserve">
+    <value>Exporting source code...</value>
+  </data>
+  <data name="GeneralExceptionMessage" xml:space="preserve">
+    <value>An error occurred:</value>
+  </data>
+  <data name="HelpCommandsMessage" xml:space="preserve">
+    <value>Specify --help for a list of available options and commands.</value>
+  </data>
+  <data name="IndexCheckCommandDescription" xml:space="preserve">
+    <value>Checks an index for problematic segments.</value>
+  </data>
+  <data name="IndexCheckCommandSegmentsDescription" xml:space="preserve">
+    <value>Only check the specified segment(s). This can be specified multiple times, to check more than one segment, eg --segment _2 --segment _a.</value>
+  </data>
+  <data name="IndexCommandDescription" xml:space="preserve">
+    <value>Utilities to analyze or maintain an index.</value>
+  </data>
+  <data name="IndexCopySegmentsCommandDescription" xml:space="preserve">
+    <value>Copies segments from one index to another index.</value>
+  </data>
+  <data name="IndexCopySegmentsCommandExtendedHelpText" xml:space="preserve">
+    <value>This tool does file-level copying of segments files. This means it's unable to split apart a single segment into multiple segments. For example if your index is a single segment, this tool won't help. Also, it does basic file-level copying (using a simple FileStream) so it will not work with non FSDirectory Directory implementations.</value>
+  </data>
+  <data name="IndexCopySegmentsCommandInputDirectoryDescription" xml:space="preserve">
+    <value>The directory of the index to copy.</value>
+  </data>
+  <data name="IndexCopySegmentsCommandOutputDirectoryDescription" xml:space="preserve">
+    <value>The directory of the destination index.</value>
+  </data>
+  <data name="IndexCopySegmentsCommandSegmentsDescription" xml:space="preserve">
+    <value>The segments to copy, separated by a space.</value>
+  </data>
+  <data name="IndexDeleteSegmentsCommandDescription" xml:space="preserve">
+    <value>Deletes segments from an index.</value>
+  </data>
+  <data name="IndexDeleteSegmentsCommandExtendedHelpText" xml:space="preserve">
+    <value>You can easily accidentally remove segments from your index so be careful! Always make a backup of your index first.</value>
+  </data>
+  <data name="IndexDeleteSegmentsCommandSegmentsDescription" xml:space="preserve">
+    <value>The segments to delete, separated by a space.</value>
+  </data>
+  <data name="IndexDirectoryArgumentDescription" xml:space="preserve">
+    <value>The directory of the index.</value>
+  </data>
+  <data name="IndexDirectoryOptionalArgumentDescription" xml:space="preserve">
+    <value>If omitted, it defaults to the current working directory.</value>
+  </data>
+  <data name="IndexExtractCfsCommandCFSFileNameDescription" xml:space="preserve">
+    <value>The .cfs file containing words to parse.</value>
+  </data>
+  <data name="IndexExtractCfsCommandDescription" xml:space="preserve">
+    <value>Lists sub-files from a .cfs compound file.</value>
+  </data>
+  <data name="IndexExtractCfsCommandExtendedHelpText" xml:space="preserve">
+    <value>The .cfs compound file format is created using the CompoundFileDirectory from Lucene.Net.Misc.</value>
+  </data>
+  <data name="IndexFixCommandDescription" xml:space="preserve">
+    <value>Fixes an index with problematic segments.</value>
+  </data>
+  <data name="IndexListCfsCommandCFSFileNameDescription" xml:space="preserve">
+    <value>The .cfs file containing words to parse.</value>
+  </data>
+  <data name="IndexListCfsCommandDescription" xml:space="preserve">
+    <value>Extracts sub-files out of a .cfs compound file.</value>
+  </data>
+  <data name="IndexListCfsCommandExtendedHelpText" xml:space="preserve">
+    <value>The .cfs compound file format is created using the CompoundFileDirectory from Lucene.Net.Misc.</value>
+  </data>
+  <data name="IndexListHighFreqTermsCommandDescription" xml:space="preserve">
+    <value>Extracts the top n most frequent terms by document frequency.</value>
+  </data>
+  <data name="IndexListHighFreqTermsCommandExtendedHelpText" xml:space="preserve">
+    <value>Extracts the top n most frequent terms (by document frequency) from an index and reports thier document frequency.</value>
+  </data>
+  <data name="IndexListHighFreqTermsCommandFieldDescription" xml:space="preserve">
+    <value>The field to consider. If omitted, considers all fields.</value>
+  </data>
+  <data name="IndexListHighFreqTermsCommandNumberOfTermsDescription" xml:space="preserve">
+    <value>The number of terms to consider. If omitted, defaults to 100.</value>
+  </data>
+  <data name="IndexListHighFreqTermsCommandTotalTermFrequencyDescription" xml:space="preserve">
+    <value>Specifies that both the document frequency &amp; term frequency are reported, ordered by descending total term frequency.</value>
+  </data>
+  <data name="IndexListSegmentsCommandDescription" xml:space="preserve">
+    <value>Lists segments in an index.</value>
+  </data>
+  <data name="IndexListTaxonomyStatsDescription" xml:space="preserve">
+    <value>Displays the taxonomy statistical information for a taxonomy index.</value>
+  </data>
+  <data name="IndexListTaxonomyStatsShowTreeDescription" xml:space="preserve">
+    <value>Recursively lists all descendent nodes.</value>
+  </data>
+  <data name="IndexListTermInfoCommandDescription" xml:space="preserve">
+    <value>Gets document frequency and total number of occurrences of a term.</value>
+  </data>
+  <data name="IndexListTermInfoCommandExtendedHelpText" xml:space="preserve">
+    <value>Gets document frequency and total number of occurrences (sum of the term frequency for each document) of a term.</value>
+  </data>
+  <data name="IndexListTermInfoCommandFieldDescription" xml:space="preserve">
+    <value>The field to consider.</value>
+  </data>
+  <data name="IndexListTermInfoCommandIndexDirectoryDescription" xml:space="preserve">
+    <value>The directory of the index.</value>
+  </data>
+  <data name="IndexListTermInfoCommandTermDescription" xml:space="preserve">
+    <value>The term to consider.</value>
+  </data>
+  <data name="IndexMergeCommandDescription" xml:space="preserve">
+    <value>Merges multiple indexes into a single index.</value>
+  </data>
+  <data name="IndexMergeCommandInputDirectoryDescription" xml:space="preserve">
+    <value>Two or more source index directories separated by a space.</value>
+  </data>
+  <data name="IndexMergeCommandOutputDirectoryDescription" xml:space="preserve">
+    <value>Output directory to merge the indexes into.</value>
+  </data>
+  <data name="IndexSplitCommandDescription" xml:space="preserve">
+    <value>Splits an index into multiple parts.</value>
+  </data>
+  <data name="IndexSplitCommandInputDirectoryDescription" xml:space="preserve">
+    <value>Path to input index. Multiple values can be provided separated by a space.</value>
+  </data>
+  <data name="IndexSplitCommandNumberOfPartsDescription" xml:space="preserve">
+    <value>The number of parts to produce.</value>
+  </data>
+  <data name="IndexSplitCommandOutputDirectoryDescription" xml:space="preserve">
+    <value>Path to output directory to contain partial indexes.</value>
+  </data>
+  <data name="IndexSplitCommandSequentialDescription" xml:space="preserve">
+    <value>Sequential docid-range split.</value>
+  </data>
+  <data name="IndexUpgradeCommandDeleteDescription" xml:space="preserve">
+    <value>Deletes prior commits.</value>
+  </data>
+  <data name="IndexUpgradeCommandDescription" xml:space="preserve">
+    <value>Upgrades all segments of an index from previous Lucene.Net versions to the current segment file format.</value>
+  </data>
+  <data name="IndexUpgradeCommandExtendedHelpText" xml:space="preserve">
+    <value>This tool keeps only the last commit in an index; for this reason, if the incoming index has more than one commit, the tool refuses to run by default. Specify --delete-prior-commits to override this, allowing the tool to delete all but the last commit. Specify an FSDirectory implementation through the --directory-type option to force its use. If not qualified by an AssemblyName, the Lucene.Net.dll assembly will be used. WARNING: This tool may reorder document IDs! Also, ensure you are using the correct version of this utility to match your application's version of Lucene.Net.</value>
+  </data>
+  <data name="LockCommandDescription" xml:space="preserve">
+    <value>Utilities for verifying concurrent locking integrity.</value>
+  </data>
+  <data name="LockStressTestCommandCountDescription" xml:space="preserve">
+    <value>Number of locking tries.</value>
+  </data>
+  <data name="LockStressTestCommandDescription" xml:space="preserve">
+    <value>Simple standalone tool that forever acquires &amp; releases a lock using a specific LockFactory.</value>
+  </data>
+  <data name="LockStressTestCommandExtendedHelpText" xml:space="preserve">
+    <value>You should run multiple instances of this process, each with its own unique ID, and each pointing to the same lock directory, to verify that locking is working correctly. Make sure you are first running LockVerifyServer.</value>
+  </data>
+  <data name="LockStressTestCommandIDDescription" xml:space="preserve">
+    <value>int value from 0 .. 255 (should be unique for test process).</value>
+  </data>
+  <data name="LockStressTestCommandLockFactoryNameDescription" xml:space="preserve">
+    <value>Path to the lock directory (only set for Simple/NativeFSLockFactory).</value>
+  </data>
+  <data name="LockStressTestCommandLockFactoryTypeNameDescription" xml:space="preserve">
+    <value>Primary LockFactory class that we will use.</value>
+  </data>
+  <data name="LockStressTestCommandSleepTimeMSDescription" xml:space="preserve">
+    <value>Milliseconds to pause betweeen each lock obtain/release.</value>
+  </data>
+  <data name="LockStressTestCommandVerfierPortDescription" xml:space="preserve">
+    <value>Port that LockVerifyServer is listening on.</value>
+  </data>
+  <data name="LockStressTestCommandVerifierHostDescription" xml:space="preserve">
+    <value>Hostname that LockVerifyServer is listening on.</value>
+  </data>
+  <data name="LockVerifyServerCommandDescription" xml:space="preserve">
+    <value>Simple standalone server that must be running when you use VerifyingLockFactory. This server verifies at most one process holds the lock at a time.</value>
+  </data>
+  <data name="LockVerifyServerCommandIPHostnameDescription" xml:space="preserve">
+    <value>Hostname or IP address that LockVerifyServer will listen on.</value>
+  </data>
+  <data name="LockVerifyServerCommandMaxClientsDescription" xml:space="preserve">
+    <value>The maximum number of concurrent clients.</value>
+  </data>
+  <data name="NotEnoughArguments" xml:space="preserve">
+    <value>{0} arguments are required.</value>
+  </data>
+  <data name="OutputSourceCodeDescription" xml:space="preserve">
+    <value>Output the source code of the demo to the specified directory.</value>
+  </data>
+  <data name="OutputSourceCodeMessage" xml:space="preserve">
+    <value>Run 'demo {0} --view-source-code' to see the C# code or 'demo {0} --output-source-code &lt;DIRECTORY&gt;' to export the code to a local directory.</value>
+  </data>
+  <data name="RootCommandDescription" xml:space="preserve">
+    <value>Utilities and demos for Lucene.Net.</value>
+  </data>
+  <data name="SegmentsArgumentDescription" xml:space="preserve">
+    <value>One or more segments, separated by a space.</value>
+  </data>
+  <data name="SegmentsOptionDescription" xml:space="preserve">
+    <value>An index segment.</value>
+  </data>
+  <data name="SegmentsOptionMultipleDescription" xml:space="preserve">
+    <value>Multiple segments are allowed.</value>
+  </data>
+  <data name="VerboseOptionDescription" xml:space="preserve">
+    <value>Verbose output.</value>
+  </data>
+  <data name="ViewSourceCodeDescription" xml:space="preserve">
+    <value>View the source code of the demo.</value>
+  </data>
+</root>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/9e389540/src/tools/lucene-cli/SourceCode/ConsolePager.cs
----------------------------------------------------------------------
diff --git a/src/tools/lucene-cli/SourceCode/ConsolePager.cs b/src/tools/lucene-cli/SourceCode/ConsolePager.cs
new file mode 100644
index 0000000..101935f
--- /dev/null
+++ b/src/tools/lucene-cli/SourceCode/ConsolePager.cs
@@ -0,0 +1,198 @@
+using Lucene.Net.Support;
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.IO;
+using System.Reflection;
+
+namespace Lucene.Net.Cli.SourceCode
+{
+    /*
+     * Licensed to the Apache Software Foundation (ASF) under one or more
+     * contributor license agreements.  See the NOTICE file distributed with
+     * this work for additional information regarding copyright ownership.
+     * The ASF licenses this file to You under the Apache License, Version 2.0
+     * (the "License"); you may not use this file except in compliance with
+     * the License.  You may obtain a copy of the License at
+     *
+     *     http://www.apache.org/licenses/LICENSE-2.0
+     *
+     * Unless required by applicable law or agreed to in writing, software
+     * distributed under the License is distributed on an "AS IS" BASIS,
+     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     * See the License for the specific language governing permissions and
+     * limitations under the License.
+     */
+
+    /// <summary>
+    /// Interactively pages or scrolls through the list of files provided in
+    /// the constructor.
+    /// <para/>
+    /// <b>Commands</b>:
+    /// <list type="table">
+    ///     <listheader>
+    ///         <term>Keys</term>
+    ///         <description>Description</description>
+    ///     </listheader>
+    ///     <item>
+    ///         <term><c>n</c> or Space</term>
+    ///         <description>Pages to the next full screen of text.</description>
+    ///     </item>
+    ///     <item>
+    ///         <term><c>q</c> or <c>x</c></term>
+    ///         <description>Exits the application.</description>
+    ///     </item>
+    ///     <item>
+    ///         <term>Enter</term>
+    ///         <description>
+    ///             Moves to the next line of text. Hold down
+    ///             the Enter key to scroll.
+    ///         </description>
+    ///     </item>
+    /// </list>
+    /// </summary>
+    public class ConsolePager : IDisposable
+    {
+        private readonly MultipleFileLineEnumerator enumerator;
+        private readonly IEnumerable<string> files;
+
+        public ConsolePager(IEnumerable<string> files)
+        {
+            if (files == null)
+                throw new ArgumentNullException("files");
+            this.enumerator = new MultipleFileLineEnumerator(files);
+        }
+
+        public TextWriter Out { get; set; } = Console.Out;
+        public TextReader In { get; set; } = Console.In;
+        public Func<int> GetWindowHeight { get; set; } = () => Console.WindowHeight;
+
+        public void Run()
+        {
+            try
+            {
+                Console.ForegroundColor = ConsoleColor.Yellow;
+                int take = GetWindowHeight();
+                int count = 0;
+                bool done = false;
+                do
+                {
+                    while (count++ < take)
+                    {
+                        done = !enumerator.MoveNext();
+                        if (done) break;
+                        Out.WriteLine(enumerator.Current);
+                    }
+                    count = 0; // Reset
+                    bool valid = false;
+                    while (!valid)
+                    {
+                        var keyInfo = Console.ReadKey(true);
+
+                        switch (keyInfo.KeyChar)
+                        {
+                            case 'q': // quit
+                            case 'x':
+                                done = valid = true;
+                                break;
+                            case 'n':
+                            case ' ':
+                                take = GetWindowHeight(); // Get next page
+                                valid = true;
+                                break;
+                            case (char)13: // ENTER
+                                take = 1; // Get a single line
+                                valid = true;
+                                break;
+                        }
+                    }
+                } while (!done);
+            }
+            finally
+            {
+                Console.ResetColor();
+            }
+        }
+
+        public void Dispose()
+        {
+            this.enumerator?.Dispose();
+        }
+
+        /// <summary>
+        /// Enumerates through a list of files (embedded resources)
+        /// as if they were one contiguous set of text.
+        /// </summary>
+        internal class MultipleFileLineEnumerator : IEnumerator<string>
+        {
+            private static Assembly thisAssembly = typeof(Program).GetTypeInfo().Assembly;
+
+            private readonly IEnumerator<string> fileEnumerator;
+            private TextReader currentFile;
+            private string line = null;
+
+            public MultipleFileLineEnumerator(IEnumerable<string> files)
+            {
+                if (files == null)
+                    throw new ArgumentNullException("files");
+                this.fileEnumerator = files.GetEnumerator();
+                NextFile();
+            }
+
+            private bool NextFile()
+            {
+
+                if (this.fileEnumerator.MoveNext())
+                {
+                    currentFile = new SourceCodeSectionReader(new StreamReader(
+                        thisAssembly.FindAndGetManifestResourceStream(typeof(Program), this.fileEnumerator.Current), 
+                        SourceCodeSectionParser.ENCODING));
+                    return true;
+                }
+                return false;
+            }
+
+            public string Current
+            {
+                get
+                {
+                    return line;
+                }
+            }
+
+            object IEnumerator.Current
+            {
+                get
+                {
+                    return line;
+                }
+            }
+
+            public void Dispose()
+            {
+                this.fileEnumerator?.Dispose();
+                this.currentFile?.Dispose();
+            }
+
+            public bool MoveNext()
+            {
+                line = this.currentFile.ReadLine();
+                if (line == null)
+                {
+                    if (!NextFile())
+                    {
+                        return false;
+                    }
+
+                    line = this.currentFile.ReadLine();
+                }
+                return line != null;
+            }
+
+            public void Reset()
+            {
+                throw new NotSupportedException();
+            }
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/9e389540/src/tools/lucene-cli/SourceCode/SourceCodeExporter.cs
----------------------------------------------------------------------
diff --git a/src/tools/lucene-cli/SourceCode/SourceCodeExporter.cs b/src/tools/lucene-cli/SourceCode/SourceCodeExporter.cs
new file mode 100644
index 0000000..483e7d8
--- /dev/null
+++ b/src/tools/lucene-cli/SourceCode/SourceCodeExporter.cs
@@ -0,0 +1,59 @@
+using Lucene.Net.Support;
+using System.Collections.Generic;
+using System.IO;
+using System.Reflection;
+
+namespace Lucene.Net.Cli.SourceCode
+{
+    /*
+     * Licensed to the Apache Software Foundation (ASF) under one or more
+     * contributor license agreements.  See the NOTICE file distributed with
+     * this work for additional information regarding copyright ownership.
+     * The ASF licenses this file to You under the Apache License, Version 2.0
+     * (the "License"); you may not use this file except in compliance with
+     * the License.  You may obtain a copy of the License at
+     *
+     *     http://www.apache.org/licenses/LICENSE-2.0
+     *
+     * Unless required by applicable law or agreed to in writing, software
+     * distributed under the License is distributed on an "AS IS" BASIS,
+     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     * See the License for the specific language governing permissions and
+     * limitations under the License.
+     */
+
+    /// <summary>
+    /// Exports source code files from embedded resources and includes or
+    /// excludes any sections that are marked by comment tokens. See
+    /// <see cref="SourceCodeSectionReader"/> for for the supported tokens.
+    /// </summary>
+    public class SourceCodeExporter
+    {
+        protected SourceCodeSectionParser sectionParser = new SourceCodeSectionParser();
+
+        /// <summary>
+        /// Reads the provided source code <paramref name="files"/> from the 
+        /// embeded resources within this assembly
+        /// and writes them out to the <paramref name="outputPath"/>.
+        /// </summary>
+        /// <param name="files">An <see cref="IEnumerable{T}"/> of files to export.</param>
+        /// <param name="outputPath">A directory where the files will be exported.</param>
+        public void ExportSourceCodeFiles(IEnumerable<string> files, string outputPath)
+        {
+            if (!Directory.Exists(outputPath))
+            {
+                Directory.CreateDirectory(outputPath);
+            }
+            var thisAssembly = this.GetType().GetTypeInfo().Assembly;
+
+            foreach (var file in files)
+            {
+                using (var input = thisAssembly.FindAndGetManifestResourceStream(typeof(Program), file))
+                using (var output = new FileStream(Path.Combine(outputPath, file), FileMode.Create, FileAccess.Write))
+                {
+                    sectionParser.ParseSourceCodeFiles(input, output);
+                }
+            }
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/9e389540/src/tools/lucene-cli/SourceCode/SourceCodeSectionParser.cs
----------------------------------------------------------------------
diff --git a/src/tools/lucene-cli/SourceCode/SourceCodeSectionParser.cs b/src/tools/lucene-cli/SourceCode/SourceCodeSectionParser.cs
new file mode 100644
index 0000000..9d2abcfc
--- /dev/null
+++ b/src/tools/lucene-cli/SourceCode/SourceCodeSectionParser.cs
@@ -0,0 +1,100 @@
+using System.IO;
+using System.Text;
+
+namespace Lucene.Net.Cli.SourceCode
+{
+    /*
+     * Licensed to the Apache Software Foundation (ASF) under one or more
+     * contributor license agreements.  See the NOTICE file distributed with
+     * this work for additional information regarding copyright ownership.
+     * The ASF licenses this file to You under the Apache License, Version 2.0
+     * (the "License"); you may not use this file except in compliance with
+     * the License.  You may obtain a copy of the License at
+     *
+     *     http://www.apache.org/licenses/LICENSE-2.0
+     *
+     * Unless required by applicable law or agreed to in writing, software
+     * distributed under the License is distributed on an "AS IS" BASIS,
+     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     * See the License for the specific language governing permissions and
+     * limitations under the License.
+     */
+
+    /// <summary>
+    /// Idenitifies sections of code based on tokens to transform 
+    /// the output code to either contain extra code sections or
+    /// remove unwanted code sections.
+    /// <para/>
+    /// There are 5 different types of tokens considered:
+    /// <list type="table">
+    ///     <item>
+    ///         <term>// &lt;comment&gt;</term>
+    ///         <description>
+    ///             Beginning of commented block. This line and all lines 
+    ///             until the end of a comment block are ignored.
+    ///             </description>
+    ///     </item>
+    ///     <item>
+    ///         <term>// &lt;\comment&gt;</term>
+    ///         <description>
+    ///             End of a commented block. This line is ignored, but any 
+    ///             lines following will be included.
+    ///         </description>
+    ///     </item>
+    ///     <item>
+    ///         <term>// &lt;include&gt;</term>
+    ///         <description>
+    ///             Beginning of an include block. This line is ignored, but 
+    ///             all lines following will have the //// comment marker 
+    ///             removed from the beginning of the line. Effectively, 
+    ///             it uncomments lines of code that were previously commented 
+    ///             and ignored by the compiler. All normal C# comments (// and ///) 
+    ///             are ignored and left in place.
+    ///         </description>
+    ///     </item>
+    ///     <item>
+    ///         <term>// &lt;\\include&gt;</term>
+    ///         <description>
+    ///             End of an include block. This line is ignored and following
+    ///             lines will be treated normally again. In other words, the ////
+    ///             comment will no longer be removed from following lines.
+    ///         </description>
+    ///     </item>
+    ///     <item>
+    ///         <term>////</term>
+    ///         <description>
+    ///             A double comment. This comment is removed in include blocks
+    ///             to uncomment code that was previously commented and ignored
+    ///             by the compiler. This allows adding using directives, alternate
+    ///             type names, etc. to be output in the demo even if they don't exist
+    ///             in the compiled application.
+    ///         </description>
+    ///     </item>
+    /// </list>
+    /// </summary>
+    public class SourceCodeSectionParser
+    {
+        public static readonly Encoding ENCODING = Encoding.UTF8;
+
+        /// <summary>
+        /// Parses the source code from the <paramref name="input"/> and places the
+        /// valid lines (the lines that are not commented with a token,
+        /// those that are included with a token, and "normal" lines)
+        /// into the <paramref name="output"/>.
+        /// </summary>
+        /// <param name="input">A stream with the input data. This stream will still be open when the call completes.</param>
+        /// <param name="output">A stream where the output data will be sent. This stream will still be open when the call completes.</param>
+        public void ParseSourceCodeFiles(Stream input, Stream output)
+        {
+            using (var reader = new SourceCodeSectionReader(new StreamReader(input, ENCODING, false, 1024, true)))
+            using (TextWriter writer = new StreamWriter(output, ENCODING, 1024, true))
+            {
+                string line;
+                while ((line = reader.ReadLine()) != null)
+                {
+                    writer.WriteLine(line);
+                }
+            }
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/9e389540/src/tools/lucene-cli/SourceCode/SourceCodeSectionReader.cs
----------------------------------------------------------------------
diff --git a/src/tools/lucene-cli/SourceCode/SourceCodeSectionReader.cs b/src/tools/lucene-cli/SourceCode/SourceCodeSectionReader.cs
new file mode 100644
index 0000000..6812037
--- /dev/null
+++ b/src/tools/lucene-cli/SourceCode/SourceCodeSectionReader.cs
@@ -0,0 +1,157 @@
+using System;
+using System.IO;
+using System.Text.RegularExpressions;
+
+namespace Lucene.Net.Cli.SourceCode
+{
+    /*
+     * Licensed to the Apache Software Foundation (ASF) under one or more
+     * contributor license agreements.  See the NOTICE file distributed with
+     * this work for additional information regarding copyright ownership.
+     * The ASF licenses this file to You under the Apache License, Version 2.0
+     * (the "License"); you may not use this file except in compliance with
+     * the License.  You may obtain a copy of the License at
+     *
+     *     http://www.apache.org/licenses/LICENSE-2.0
+     *
+     * Unless required by applicable law or agreed to in writing, software
+     * distributed under the License is distributed on an "AS IS" BASIS,
+     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     * See the License for the specific language governing permissions and
+     * limitations under the License.
+     */
+
+    /// <summary>
+    /// A <see cref="TextReader"/> that conditionally includes or excludes lines 
+    /// of source code based on commented sections in the original
+    /// source.
+    /// </summary>
+    /// <remarks>
+    /// Idenitifies sections of code based on tokens to transform 
+    /// the output code to either contain extra code sections or
+    /// remove unwanted code sections.
+    /// <para/>
+    /// There are 5 different types of tokens considered:
+    /// <list type="table">
+    ///     <item>
+    ///         <term>// &lt;comment&gt;</term>
+    ///         <description>
+    ///             Beginning of commented block. This line and all lines 
+    ///             until the end of a comment block are ignored.
+    ///             </description>
+    ///     </item>
+    ///     <item>
+    ///         <term>// &lt;\comment&gt;</term>
+    ///         <description>
+    ///             End of a commented block. This line is ignored, but any 
+    ///             lines following will be included.
+    ///         </description>
+    ///     </item>
+    ///     <item>
+    ///         <term>// &lt;include&gt;</term>
+    ///         <description>
+    ///             Beginning of an include block. This line is ignored, but 
+    ///             all lines following will have the //// comment marker 
+    ///             removed from the beginning of the line. Effectively, 
+    ///             it uncomments lines of code that were previously commented 
+    ///             and ignored by the compiler. All normal C# comments (// and ///) 
+    ///             are ignored and left in place.
+    ///         </description>
+    ///     </item>
+    ///     <item>
+    ///         <term>// &lt;\\include&gt;</term>
+    ///         <description>
+    ///             End of an include block. This line is ignored and following
+    ///             lines will be treated normally again. In other words, the ////
+    ///             comment will no longer be removed from following lines.
+    ///         </description>
+    ///     </item>
+    ///     <item>
+    ///         <term>////</term>
+    ///         <description>
+    ///             A double comment. This comment is removed in include blocks
+    ///             to uncomment code that was previously commented and ignored
+    ///             by the compiler. This allows adding using directives, alternate
+    ///             type names, etc. to be output in the demo even if they don't exist
+    ///             in the compiled application.
+    ///         </description>
+    ///     </item>
+    /// </list>
+    /// </remarks>
+    public class SourceCodeSectionReader : TextReader
+    {
+        public static readonly Regex COMMENT_START = new Regex(@"//\s*?<comment>", RegexOptions.Compiled);
+        public static readonly Regex COMMENT_END = new Regex(@"//\s*?</comment>", RegexOptions.Compiled);
+        public static readonly Regex INCLUDE_START = new Regex(@"//\s*?<include>", RegexOptions.Compiled);
+        public static readonly Regex INCLUDE_END = new Regex(@"//\s*?</include>", RegexOptions.Compiled);
+        public static readonly Regex TO_UNCOMMENT = new Regex(@"////", RegexOptions.Compiled);
+
+        private bool inComment = false;
+        private bool inInclude = false;
+
+        private readonly TextReader reader;
+
+        public SourceCodeSectionReader(TextReader reader)
+        {
+            if (reader == null)
+                throw new ArgumentNullException("reader");
+            this.reader = reader;
+        }
+
+        public override string ReadLine()
+        {
+            string line;
+            while ((line = reader.ReadLine()) != null)
+            {
+                if (inComment)
+                {
+                    if (COMMENT_END.IsMatch(line))
+                    {
+                        inComment = false;
+                        continue; // Skip this line
+                    }
+                }
+                else
+                {
+                    if (COMMENT_START.IsMatch(line))
+                    {
+                        inComment = true;
+                        continue; // Skip this line
+                    }
+                    else
+                    {
+                        // If not in a comment, consider source code includes.
+                        // In this case, we will remove //// from the beginning of
+                        // each line if it exists.
+                        if (inInclude)
+                        {
+                            if (INCLUDE_END.IsMatch(line))
+                            {
+                                inInclude = false;
+                                continue; // Skip this line
+                            }
+                            line = TO_UNCOMMENT.Replace(line, string.Empty, 1);
+                        }
+                        else if (INCLUDE_START.IsMatch(line))
+                        {
+                            inInclude = true;
+                            continue; // Skip this line
+                        }
+                    }
+
+                    // All other lines, include the line
+                    return line;
+                }
+            }
+            return line;
+        }
+
+        protected override void Dispose(bool disposing)
+        {
+            if (disposing)
+            {
+                this.reader?.Dispose();
+            }
+        }
+    }
+}


[05/22] lucenenet git commit: Added lucene-cli + tests - a wrapper console application so we can run the various utilities and demos in .NET on the command line.

Posted by ni...@apache.org.
Added lucene-cli + tests - a wrapper console application so we can run the various utilities and demos in .NET on the command line.


Project: http://git-wip-us.apache.org/repos/asf/lucenenet/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucenenet/commit/9e389540
Tree: http://git-wip-us.apache.org/repos/asf/lucenenet/tree/9e389540
Diff: http://git-wip-us.apache.org/repos/asf/lucenenet/diff/9e389540

Branch: refs/heads/master
Commit: 9e38954039ccf941cf0dc0c19b0d180341fb8c8e
Parents: f0b56fd
Author: Shad Storhaug <sh...@shadstorhaug.com>
Authored: Thu Jul 6 19:42:54 2017 +0700
Committer: Shad Storhaug <sh...@shadstorhaug.com>
Committed: Thu Jul 6 19:42:54 2017 +0700

----------------------------------------------------------------------
 Lucene.Net.Portable.sln                         |  26 +
 .../Commands/Analysis/AnalysisCommandTest.cs    |  48 +
 .../AnalysisStempelCompileStemsCommandTest.cs   |  58 ++
 .../AnalysisStempelPatchStemsCommandTest.cs     |  57 ++
 .../Commands/CommandTestCase.cs                 | 170 ++++
 .../Commands/Demo/DemoCommandTest.cs            |  48 +
 .../Commands/Index/IndexCheckCommandTest.cs     | 109 +++
 .../Commands/Index/IndexCommandTest.cs          |  56 ++
 .../Commands/Index/IndexCopySegmentsTest.cs     |  58 ++
 .../Index/IndexDeleteSegmentsCommandTest.cs     |  58 ++
 .../Index/IndexExtractCfsCommandTest.cs         |  56 ++
 .../Commands/Index/IndexFixCommandTest.cs       |  70 ++
 .../Commands/Index/IndexListCfsCommandTest.cs   |  69 ++
 .../Index/IndexListHighFreqTermsCommandTest.cs  |  67 ++
 .../Index/IndexListSegmentsCommandTest.cs       |  63 ++
 .../Index/IndexListTaxonomyStatsCommandTest.cs  |  65 ++
 .../Index/IndexListTermInfoCommandTest.cs       |  61 ++
 .../Commands/Index/IndexMergeCommandTest.cs     |  57 ++
 .../Commands/Index/IndexSplitCommandTest.cs     |  62 ++
 .../Commands/Index/IndexUpgradeCommandTest.cs   |  67 ++
 .../Commands/Lock/LockCommandTest.cs            |  56 ++
 .../Commands/Lock/LockStressTestCommandTest.cs  |  64 ++
 .../Lock/LockVerifyServerCommandTest.cs         |  59 ++
 .../Commands/RootCommandTest.cs                 |  48 +
 .../EnumerableExtensions.cs                     |  60 ++
 .../Lucene.Net.Tests.Cli.xproj                  |  22 +
 .../Properties/AssemblyInfo.cs                  |  36 +
 .../SourceCode/SourceCodeParserTest.cs          |  72 ++
 .../SourceCode/TestInputForParser.cs            |  53 +
 .../Lucene.Net.Tests.Cli/StringExtensions.cs    |  68 ++
 src/tools/Lucene.Net.Tests.Cli/project.json     |  35 +
 .../lucene-cli/CommandLine/CommandArgument.cs   |  30 +
 .../CommandLine/CommandLineApplication.cs       | 563 +++++++++++
 .../lucene-cli/CommandLine/CommandOption.cs     | 112 +++
 .../lucene-cli/CommandLine/CommandOptionType.cs |  12 +
 .../CommandLine/CommandParsingException.cs      |  18 +
 src/tools/lucene-cli/CommandLineOptions.cs      |  74 ++
 src/tools/lucene-cli/ConfigurationBase.cs       | 130 +++
 src/tools/lucene-cli/ICommand.cs                |  27 +
 src/tools/lucene-cli/Program.cs                 |  35 +
 src/tools/lucene-cli/Properties/AssemblyInfo.cs |  37 +
 .../lucene-cli/Properties/launchSettings.json   |   7 +
 .../lucene-cli/Resources/Strings.Designer.cs    | 962 +++++++++++++++++++
 src/tools/lucene-cli/Resources/Strings.resx     | 420 ++++++++
 src/tools/lucene-cli/SourceCode/ConsolePager.cs | 198 ++++
 .../lucene-cli/SourceCode/SourceCodeExporter.cs |  59 ++
 .../SourceCode/SourceCodeSectionParser.cs       | 100 ++
 .../SourceCode/SourceCodeSectionReader.cs       | 157 +++
 .../arguments/IndexDirectoryArgument.cs         |  57 ++
 .../lucene-cli/arguments/SegmentsArgument.cs    |  31 +
 src/tools/lucene-cli/commands/RootCommand.cs    |  46 +
 .../commands/analysis/AnalysisCommand.cs        |  45 +
 .../AnalysisStempelCompileStemsCommand.cs       |  77 ++
 .../AnalysisStempelPatchStemsCommand.cs         |  70 ++
 .../lucene-cli/commands/demo/DemoCommand.cs     |  49 +
 .../commands/demo/DemoConfiguration.cs          |  90 ++
 .../DemoAssociationsFacetsCommand.cs            |  53 +
 .../DemoDistanceFacetsCommand.cs                |  53 +
 .../DemoExpressionAggregationFacetsCommand.cs   |  53 +
 .../demo-index-files/DemoIndexFilesCommand.cs   |  85 ++
 .../DemoMultiCategoryListsFacetsCommand.cs      |  53 +
 .../demo-range-facets/DemoRangeFacetsCommand.cs |  53 +
 .../demo-search-files/DemoSearchFilesCommand.cs | 134 +++
 .../DemoSimpleFacetsCommand.cs                  |  53 +
 .../DemoSimpleSortedSetFacetsCommand.cs         |  53 +
 .../lucene-cli/commands/index/IndexCommand.cs   |  53 +
 .../index/index-check/IndexCheckCommand.cs      | 103 ++
 .../IndexCopySegmentsCommand.cs                 |  54 ++
 .../IndexDeleteSegmentsCommand.cs               |  66 ++
 .../index-extract-cfs/IndexExtractCfsCommand.cs |  47 +
 .../commands/index/index-fix/IndexFixCommand.cs |  50 +
 .../index/index-list-cfs/IndexListCfsCommand.cs |  72 ++
 .../IndexListHighFreqTerms.cs                   |  86 ++
 .../IndexSegmentListCommand.cs                  |  51 +
 .../IndexListTaxonomyStatsCommand.cs            |  62 ++
 .../IndexListTermInfoCommand.cs                 |  52 +
 .../index/index-merge/IndexMergeCommand.cs      |  51 +
 .../index/index-split/IndexSplitCommand.cs      |  78 ++
 .../index/index-upgrade/IndexUpgradeCommand.cs  |  83 ++
 .../lucene-cli/commands/lock/LockCommand.cs     |  42 +
 .../lock-stress-test/LockStressTestCommand.cs   |  58 ++
 .../LockVerifyServerCommand.cs                  |  51 +
 src/tools/lucene-cli/lucene-cli.xproj           |  19 +
 .../options/CrossCheckTermVectorsOption.cs      |  31 +
 .../lucene-cli/options/DirectoryTypeOption.cs   |  30 +
 src/tools/lucene-cli/options/SegmentOption.cs   |  31 +
 src/tools/lucene-cli/options/VerboseOption.cs   |  30 +
 src/tools/lucene-cli/project.json               |  39 +
 88 files changed, 7133 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucenenet/blob/9e389540/Lucene.Net.Portable.sln
----------------------------------------------------------------------
diff --git a/Lucene.Net.Portable.sln b/Lucene.Net.Portable.sln
index 9e3b91d..bac9168 100644
--- a/Lucene.Net.Portable.sln
+++ b/Lucene.Net.Portable.sln
@@ -97,6 +97,12 @@ Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Lucene.Net.Demo", "src\Luce
 EndProject
 Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Lucene.Net.Tests.Demo", "src\Lucene.Net.Tests.Demo\Lucene.Net.Tests.Demo.xproj", "{93DF8BAA-9CAA-4142-8E96-55481188C012}"
 EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tools", "tools", "{C8F207AE-DB35-4B14-966C-C1FADCC28DAE}"
+EndProject
+Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "lucene-cli", "src\tools\lucene-cli\lucene-cli.xproj", "{D5F3414E-E743-4DCA-A50A-DA3278A2BA2B}"
+EndProject
+Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Lucene.Net.Tests.Cli", "src\tools\Lucene.Net.Tests.Cli\Lucene.Net.Tests.Cli.xproj", "{495B65F0-0B01-40FE-9DC8-5A82C49E07EF}"
+EndProject
 Global
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
 		Debug|Any CPU = Debug|Any CPU
@@ -449,8 +455,28 @@ Global
 		{93DF8BAA-9CAA-4142-8E96-55481188C012}.Release|Any CPU.Build.0 = Release|Any CPU
 		{93DF8BAA-9CAA-4142-8E96-55481188C012}.Release|x86.ActiveCfg = Release|Any CPU
 		{93DF8BAA-9CAA-4142-8E96-55481188C012}.Release|x86.Build.0 = Release|Any CPU
+		{D5F3414E-E743-4DCA-A50A-DA3278A2BA2B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{D5F3414E-E743-4DCA-A50A-DA3278A2BA2B}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{D5F3414E-E743-4DCA-A50A-DA3278A2BA2B}.Debug|x86.ActiveCfg = Debug|Any CPU
+		{D5F3414E-E743-4DCA-A50A-DA3278A2BA2B}.Debug|x86.Build.0 = Debug|Any CPU
+		{D5F3414E-E743-4DCA-A50A-DA3278A2BA2B}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{D5F3414E-E743-4DCA-A50A-DA3278A2BA2B}.Release|Any CPU.Build.0 = Release|Any CPU
+		{D5F3414E-E743-4DCA-A50A-DA3278A2BA2B}.Release|x86.ActiveCfg = Release|Any CPU
+		{D5F3414E-E743-4DCA-A50A-DA3278A2BA2B}.Release|x86.Build.0 = Release|Any CPU
+		{495B65F0-0B01-40FE-9DC8-5A82C49E07EF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{495B65F0-0B01-40FE-9DC8-5A82C49E07EF}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{495B65F0-0B01-40FE-9DC8-5A82C49E07EF}.Debug|x86.ActiveCfg = Debug|Any CPU
+		{495B65F0-0B01-40FE-9DC8-5A82C49E07EF}.Debug|x86.Build.0 = Debug|Any CPU
+		{495B65F0-0B01-40FE-9DC8-5A82C49E07EF}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{495B65F0-0B01-40FE-9DC8-5A82C49E07EF}.Release|Any CPU.Build.0 = Release|Any CPU
+		{495B65F0-0B01-40FE-9DC8-5A82C49E07EF}.Release|x86.ActiveCfg = Release|Any CPU
+		{495B65F0-0B01-40FE-9DC8-5A82C49E07EF}.Release|x86.Build.0 = Release|Any CPU
 	EndGlobalSection
 	GlobalSection(SolutionProperties) = preSolution
 		HideSolutionNode = FALSE
 	EndGlobalSection
+	GlobalSection(NestedProjects) = preSolution
+		{D5F3414E-E743-4DCA-A50A-DA3278A2BA2B} = {C8F207AE-DB35-4B14-966C-C1FADCC28DAE}
+		{495B65F0-0B01-40FE-9DC8-5A82C49E07EF} = {C8F207AE-DB35-4B14-966C-C1FADCC28DAE}
+	EndGlobalSection
 EndGlobal

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/9e389540/src/tools/Lucene.Net.Tests.Cli/Commands/Analysis/AnalysisCommandTest.cs
----------------------------------------------------------------------
diff --git a/src/tools/Lucene.Net.Tests.Cli/Commands/Analysis/AnalysisCommandTest.cs b/src/tools/Lucene.Net.Tests.Cli/Commands/Analysis/AnalysisCommandTest.cs
new file mode 100644
index 0000000..d05131b
--- /dev/null
+++ b/src/tools/Lucene.Net.Tests.Cli/Commands/Analysis/AnalysisCommandTest.cs
@@ -0,0 +1,48 @@
+using Lucene.Net.Cli.CommandLine;
+using NUnit.Framework;
+using System.Collections.Generic;
+
+namespace Lucene.Net.Cli.Commands
+{
+    /*
+     * Licensed to the Apache Software Foundation (ASF) under one or more
+     * contributor license agreements.  See the NOTICE file distributed with
+     * this work for additional information regarding copyright ownership.
+     * The ASF licenses this file to You under the Apache License, Version 2.0
+     * (the "License"); you may not use this file except in compliance with
+     * the License.  You may obtain a copy of the License at
+     *
+     *     http://www.apache.org/licenses/LICENSE-2.0
+     *
+     * Unless required by applicable law or agreed to in writing, software
+     * distributed under the License is distributed on an "AS IS" BASIS,
+     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     * See the License for the specific language governing permissions and
+     * limitations under the License.
+     */
+
+    public class AnalysisCommandTest : CommandTestCase
+    {
+        protected override ConfigurationBase CreateConfiguration(MockConsoleApp app)
+        {
+            return new AnalysisCommand.Configuration(new CommandLineOptions()) { Main = (args) => app.Main(args) };
+        }
+
+        protected override IList<Arg[]> GetOptionalArgs()
+        {
+            // NOTE: We must order this in the sequence of the expected output.
+            return new List<Arg[]>();
+        }
+        protected override IList<Arg[]> GetRequiredArgs()
+        {
+            // NOTE: We must order this in the sequence of the expected output.
+            return new List<Arg[]>();
+        }
+
+        [Test]
+        public void TestTooManyArguments()
+        {
+            Assert.Throws<CommandParsingException>(() => AssertConsoleOutput("one", ""));
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/9e389540/src/tools/Lucene.Net.Tests.Cli/Commands/Analysis/AnalysisStempelCompileStemsCommandTest.cs
----------------------------------------------------------------------
diff --git a/src/tools/Lucene.Net.Tests.Cli/Commands/Analysis/AnalysisStempelCompileStemsCommandTest.cs b/src/tools/Lucene.Net.Tests.Cli/Commands/Analysis/AnalysisStempelCompileStemsCommandTest.cs
new file mode 100644
index 0000000..951644f
--- /dev/null
+++ b/src/tools/Lucene.Net.Tests.Cli/Commands/Analysis/AnalysisStempelCompileStemsCommandTest.cs
@@ -0,0 +1,58 @@
+using NUnit.Framework;
+using System.Collections.Generic;
+
+namespace Lucene.Net.Cli.Commands
+{
+    /*
+     * Licensed to the Apache Software Foundation (ASF) under one or more
+     * contributor license agreements.  See the NOTICE file distributed with
+     * this work for additional information regarding copyright ownership.
+     * The ASF licenses this file to You under the Apache License, Version 2.0
+     * (the "License"); you may not use this file except in compliance with
+     * the License.  You may obtain a copy of the License at
+     *
+     *     http://www.apache.org/licenses/LICENSE-2.0
+     *
+     * Unless required by applicable law or agreed to in writing, software
+     * distributed under the License is distributed on an "AS IS" BASIS,
+     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     * See the License for the specific language governing permissions and
+     * limitations under the License.
+     */
+
+    public class AnalysisStempelCompileStemsCommandTest : CommandTestCase
+    {
+        protected override ConfigurationBase CreateConfiguration(MockConsoleApp app)
+        {
+            return new AnalysisStempelCompileStemsCommand.Configuration(new CommandLineOptions()) { Main = (args) => app.Main(args) };
+        }
+
+        protected override IList<Arg[]> GetOptionalArgs()
+        {
+            // NOTE: We must order this in the sequence of the expected output.
+            return new List<Arg[]>()
+            {
+                new Arg[] { new Arg(inputPattern: "-e UTF-8|--encoding UTF-8", output: new string[] { "--encoding", "UTF-8" }) },
+            };
+        }
+        protected override IList<Arg[]> GetRequiredArgs()
+        {
+            // NOTE: We must order this in the sequence of the expected output.
+            return new List<Arg[]>()
+            {
+                new Arg[] { new Arg(inputPattern: "substitution", output: new string[] { @"substitution" }) },
+                new Arg[] {
+                    new Arg(inputPattern: @"C:\lucene-temp\foo.txt", output: new string[] { @"C:\lucene-temp\foo.txt" }),
+                    new Arg(inputPattern: @"C:\lucene-temp\foo.txt C:\lucene-temp\foo2.txt", output: new string[] { @"C:\lucene-temp\foo.txt", @"C:\lucene-temp\foo2.txt" }),
+                },
+            };
+        }
+
+        [Test]
+        public void TestNotEnoughArguments()
+        {
+            Assert.NotNull(FromResource("NotEnoughArguments"));
+            AssertConsoleOutput("one", FromResource("NotEnoughArguments", 2));
+        }
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/9e389540/src/tools/Lucene.Net.Tests.Cli/Commands/Analysis/AnalysisStempelPatchStemsCommandTest.cs
----------------------------------------------------------------------
diff --git a/src/tools/Lucene.Net.Tests.Cli/Commands/Analysis/AnalysisStempelPatchStemsCommandTest.cs b/src/tools/Lucene.Net.Tests.Cli/Commands/Analysis/AnalysisStempelPatchStemsCommandTest.cs
new file mode 100644
index 0000000..0a21a1f
--- /dev/null
+++ b/src/tools/Lucene.Net.Tests.Cli/Commands/Analysis/AnalysisStempelPatchStemsCommandTest.cs
@@ -0,0 +1,57 @@
+using NUnit.Framework;
+using System.Collections.Generic;
+
+namespace Lucene.Net.Cli.Commands.Analysis
+{
+    /*
+     * Licensed to the Apache Software Foundation (ASF) under one or more
+     * contributor license agreements.  See the NOTICE file distributed with
+     * this work for additional information regarding copyright ownership.
+     * The ASF licenses this file to You under the Apache License, Version 2.0
+     * (the "License"); you may not use this file except in compliance with
+     * the License.  You may obtain a copy of the License at
+     *
+     *     http://www.apache.org/licenses/LICENSE-2.0
+     *
+     * Unless required by applicable law or agreed to in writing, software
+     * distributed under the License is distributed on an "AS IS" BASIS,
+     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     * See the License for the specific language governing permissions and
+     * limitations under the License.
+     */
+
+    public class AnalysisStempelPatchStemsCommandTest : CommandTestCase
+    {
+        protected override ConfigurationBase CreateConfiguration(MockConsoleApp app)
+        {
+            return new AnalysisStempelPatchStemsCommand.Configuration(new CommandLineOptions()) { Main = (args) => app.Main(args) };
+        }
+
+        protected override IList<Arg[]> GetOptionalArgs()
+        {
+            // NOTE: We must order this in the sequence of the expected output.
+            return new List<Arg[]>()
+            {
+                new Arg[] { new Arg(inputPattern: "-e UTF-8|--encoding UTF-8", output: new string[] { "--encoding", "UTF-8" }) },
+            };
+        }
+        protected override IList<Arg[]> GetRequiredArgs()
+        {
+            // NOTE: We must order this in the sequence of the expected output.
+            return new List<Arg[]>()
+            {
+                new Arg[] {
+                    new Arg(inputPattern: @"C:\lucene-temp\foo.txt", output: new string[] { @"C:\lucene-temp\foo.txt" }),
+                    new Arg(inputPattern: @"C:\lucene-temp\foo.txt C:\lucene-temp\foo2.txt", output: new string[] { @"C:\lucene-temp\foo.txt", @"C:\lucene-temp\foo2.txt" }),
+                },
+            };
+        }
+
+        [Test]
+        public void TestNotEnoughArguments()
+        {
+            Assert.NotNull(FromResource("NotEnoughArguments"));
+            AssertConsoleOutput("", FromResource("NotEnoughArguments", 1));
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/9e389540/src/tools/Lucene.Net.Tests.Cli/Commands/CommandTestCase.cs
----------------------------------------------------------------------
diff --git a/src/tools/Lucene.Net.Tests.Cli/Commands/CommandTestCase.cs b/src/tools/Lucene.Net.Tests.Cli/Commands/CommandTestCase.cs
new file mode 100644
index 0000000..0b1917d
--- /dev/null
+++ b/src/tools/Lucene.Net.Tests.Cli/Commands/CommandTestCase.cs
@@ -0,0 +1,170 @@
+using NUnit.Framework;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+
+namespace Lucene.Net.Cli.Commands
+{
+    /*
+     * Licensed to the Apache Software Foundation (ASF) under one or more
+     * contributor license agreements.  See the NOTICE file distributed with
+     * this work for additional information regarding copyright ownership.
+     * The ASF licenses this file to You under the Apache License, Version 2.0
+     * (the "License"); you may not use this file except in compliance with
+     * the License.  You may obtain a copy of the License at
+     *
+     *     http://www.apache.org/licenses/LICENSE-2.0
+     *
+     * Unless required by applicable law or agreed to in writing, software
+     * distributed under the License is distributed on an "AS IS" BASIS,
+     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     * See the License for the specific language governing permissions and
+     * limitations under the License.
+     */
+
+    // LUCENENET TODO: Move to TestFramework ?
+    public abstract class CommandTestCase
+    {
+        [SetUp]
+        protected virtual void SetUp()
+        {
+        }
+
+        [TearDown]
+        protected virtual void TearDown()
+        {
+        }
+
+        protected abstract ConfigurationBase CreateConfiguration(MockConsoleApp app);
+
+        protected abstract IList<Arg[]> GetRequiredArgs();
+        protected abstract IList<Arg[]> GetOptionalArgs();
+
+        protected virtual void AssertCommandTranslation(string command, string[] expectedResult)
+        {
+            var output = new MockConsoleApp();
+            var cmd = CreateConfiguration(output);
+            cmd.Execute(command.ToArgs());
+
+            Assert.AreEqual(expectedResult.Length, output.Args.Length);
+            for (int i = 0; i < output.Args.Length; i++)
+            {
+                Assert.AreEqual(expectedResult[i], output.Args[i], "Command: {0}, Expected: {1}, Actual {2}", command, string.Join(",", expectedResult), string.Join(",", output.Args[i]));
+            }
+        }
+
+        protected virtual void AssertConsoleOutput(string command, string expectedConsoleText)
+        {
+            var output = new MockConsoleApp();
+            var cmd = CreateConfiguration(output);
+
+            var console = new StringWriter();
+            cmd.Out = console;
+            cmd.Execute(command.ToArgs());
+
+            string consoleText = console.ToString();
+            Assert.True(consoleText.Contains(expectedConsoleText), "Expected output was {0}, actual console output was {1}", expectedConsoleText, consoleText);
+        }
+
+        protected virtual string FromResource(string resourceName)
+        {
+            return Resources.Strings.ResourceManager.GetString(resourceName);
+        }
+
+        protected virtual string FromResource(string resourceName, params object[] args)
+        {
+            return string.Format(Resources.Strings.ResourceManager.GetString(resourceName), args);
+        }
+
+        [Test]
+        public virtual void TestAllValidCombinations()
+        {
+            var requiredArgs = GetRequiredArgs().ExpandArgs().RequiredParameters();
+            var optionalArgs = GetOptionalArgs().ExpandArgs().OptionalParameters();
+
+            foreach (var requiredArg in requiredArgs)
+            {
+                AssertCommandTranslation(
+                    string.Join(" ", requiredArg.Select(x => x.InputPattern).ToArray()),
+                    requiredArg.SelectMany(x => x.Output).ToArray());
+            }
+
+            foreach (var requiredArg in requiredArgs)
+            {
+                foreach (var optionalArg in optionalArgs)
+                {
+                    string command = string.Join(" ", requiredArg.Select(x => x.InputPattern).Union(optionalArg.Select(x => x.InputPattern).ToArray()));
+                    string[] expected = requiredArg.SelectMany(x => x.Output).Concat(optionalArg.SelectMany(x => x.Output)).ToArray();
+                    AssertCommandTranslation(command, expected);
+                }
+            }
+        }
+
+        [Test]
+        public virtual void TestHelp()
+        {
+            AssertConsoleOutput("?", "Version");
+        }
+
+        public class MockConsoleApp
+        {
+            public void Main(string[] args)
+            {
+                this.Args = args;
+            }
+
+            public string[] Args { get; private set; }
+        }
+
+        public class Arg
+        {
+            public Arg(string inputPattern, string[] output)
+            {
+                InputPattern = inputPattern;
+                Output = output;
+            }
+
+            public string InputPattern { get; private set; }
+            public string[] Output { get; private set; }
+        }
+    }
+
+    public static class ListExtensions
+    {
+        // Breaks out any options based on logical OR | symbol
+        public static IList<CommandTestCase.Arg[]> ExpandArgs(this IList<CommandTestCase.Arg[]> args)
+        {
+            var result = new List<CommandTestCase.Arg[]>();
+            foreach (var arg in args)
+            {
+                result.Add(ExpandArgs(arg));
+            }
+
+            return result;
+        }
+
+        public static CommandTestCase.Arg[] ExpandArgs(this CommandTestCase.Arg[] args)
+        {
+            var result = new List<CommandTestCase.Arg>();
+            if (args != null)
+            {
+                foreach (var arg in args)
+                {
+                    if (arg.InputPattern.Contains("|"))
+                    {
+                        var options = arg.InputPattern.Split('|');
+                        foreach (var option in options)
+                        {
+                            result.Add(new CommandTestCase.Arg(option, (string[])arg.Output.Clone()));
+                        }
+                    }
+                    else
+                    {
+                        result.Add(arg);
+                    }
+                }
+            }
+            return result.ToArray();
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/9e389540/src/tools/Lucene.Net.Tests.Cli/Commands/Demo/DemoCommandTest.cs
----------------------------------------------------------------------
diff --git a/src/tools/Lucene.Net.Tests.Cli/Commands/Demo/DemoCommandTest.cs b/src/tools/Lucene.Net.Tests.Cli/Commands/Demo/DemoCommandTest.cs
new file mode 100644
index 0000000..4c57bbb
--- /dev/null
+++ b/src/tools/Lucene.Net.Tests.Cli/Commands/Demo/DemoCommandTest.cs
@@ -0,0 +1,48 @@
+using Lucene.Net.Cli.CommandLine;
+using NUnit.Framework;
+using System.Collections.Generic;
+
+namespace Lucene.Net.Cli.Commands
+{
+    /*
+     * Licensed to the Apache Software Foundation (ASF) under one or more
+     * contributor license agreements.  See the NOTICE file distributed with
+     * this work for additional information regarding copyright ownership.
+     * The ASF licenses this file to You under the Apache License, Version 2.0
+     * (the "License"); you may not use this file except in compliance with
+     * the License.  You may obtain a copy of the License at
+     *
+     *     http://www.apache.org/licenses/LICENSE-2.0
+     *
+     * Unless required by applicable law or agreed to in writing, software
+     * distributed under the License is distributed on an "AS IS" BASIS,
+     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     * See the License for the specific language governing permissions and
+     * limitations under the License.
+     */
+
+    public class DemoCommandTest : CommandTestCase
+    {
+        protected override ConfigurationBase CreateConfiguration(MockConsoleApp app)
+        {
+            return new DemoCommand.Configuration(new CommandLineOptions()) { Main = (args) => app.Main(args) };
+        }
+
+        protected override IList<Arg[]> GetOptionalArgs()
+        {
+            // NOTE: We must order this in the sequence of the expected output.
+            return new List<Arg[]>();
+        }
+        protected override IList<Arg[]> GetRequiredArgs()
+        {
+            // NOTE: We must order this in the sequence of the expected output.
+            return new List<Arg[]>();
+        }
+
+        [Test]
+        public void TestTooManyArguments()
+        {
+            Assert.Throws<CommandParsingException>(() => AssertConsoleOutput("one", ""));
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/9e389540/src/tools/Lucene.Net.Tests.Cli/Commands/Index/IndexCheckCommandTest.cs
----------------------------------------------------------------------
diff --git a/src/tools/Lucene.Net.Tests.Cli/Commands/Index/IndexCheckCommandTest.cs b/src/tools/Lucene.Net.Tests.Cli/Commands/Index/IndexCheckCommandTest.cs
new file mode 100644
index 0000000..0ec00ef
--- /dev/null
+++ b/src/tools/Lucene.Net.Tests.Cli/Commands/Index/IndexCheckCommandTest.cs
@@ -0,0 +1,109 @@
+using NUnit.Framework;
+using System.Collections.Generic;
+
+namespace Lucene.Net.Cli.Commands
+{
+    /*
+     * Licensed to the Apache Software Foundation (ASF) under one or more
+     * contributor license agreements.  See the NOTICE file distributed with
+     * this work for additional information regarding copyright ownership.
+     * The ASF licenses this file to You under the Apache License, Version 2.0
+     * (the "License"); you may not use this file except in compliance with
+     * the License.  You may obtain a copy of the License at
+     *
+     *     http://www.apache.org/licenses/LICENSE-2.0
+     *
+     * Unless required by applicable law or agreed to in writing, software
+     * distributed under the License is distributed on an "AS IS" BASIS,
+     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     * See the License for the specific language governing permissions and
+     * limitations under the License.
+     */
+
+    // LUCENENET TODO: Test to ensure all of the commands and arguments have a description (in all commands except for root)
+
+    public class IndexCheckCommandTest : CommandTestCase
+    {
+        protected override ConfigurationBase CreateConfiguration(MockConsoleApp app)
+        {
+            return new IndexCheckCommand.Configuration(new CommandLineOptions()) { Main = (args) => app.Main(args) };
+        }
+
+        protected override IList<Arg[]> GetOptionalArgs()
+        {
+            // NOTE: We must order this in the sequence of the expected output.
+            return new List<Arg[]>()
+            {
+                new Arg[] { new Arg(inputPattern: "-c|--cross-check-term-vectors", output: new string[] { "-crossCheckTermVectors" }) },
+                new Arg[] { new Arg(inputPattern: "--verbose", output: new string[] { "-verbose" }) },
+                new Arg[] {
+                    new Arg(inputPattern: "-s _seg1|--segment _seg1", output: new string[] { "-segment", "_seg1" }),
+                    new Arg(inputPattern: "-s _seg1 -s _seg2|--segment _seg1 --segment _seg2", output: new string[] { "-segment", "_seg1", "-segment", "_seg2" }),
+                    new Arg(inputPattern: "-s _seg1 -s _seg2 -s _seg3|--segment _seg1 --segment _seg2 --segment _seg3", output: new string[] { "-segment", "_seg1", "-segment", "_seg2", "-segment", "_seg3" })
+                },
+                new Arg[] { new Arg(inputPattern: "-dir SimpleFSDirectory|--directory-type SimpleFSDirectory", output: new string[] { "-dir-impl", "SimpleFSDirectory" }) },
+            };
+        }
+        protected override IList<Arg[]> GetRequiredArgs()
+        {
+            // NOTE: We must order this in the sequence of the expected output.
+            return new List<Arg[]>()
+            {
+                new Arg[] { new Arg(inputPattern: @"C:\lucene-temp", output: new string[] { @"C:\lucene-temp" }) },
+            };
+        }
+
+        
+
+
+
+        //[Test]
+        //public void TestAllOptionsShort()
+        //{
+        //    AssertCommandTranslation(
+        //        @"C:\lucene-temp -v -c -dir SimpleFSDirectory -s _seg1 -s _seg2 -s _seg3",
+        //        new string[] {
+        //            @"C:\lucene-temp", "-crossCheckTermVectors", "-verbose",
+        //            "-segment", "_seg1", "-segment", "_seg2", "-segment", "_seg3",
+        //            "-dir-impl", "SimpleFSDirectory"
+        //        });
+
+        //    //var output = new MockConsoleApp();
+        //    //var cmd = new IndexCheckCommand.Configuration(new CommandLineOptions()) { Main = (args) => output.Main(args) };
+
+        //    //string input = @"C:\lucene-temp -v -c -dir SimpleFSDirectory -s _seg1 -s _seg2 -s _seg3";
+        //    //cmd.Execute(input.ToArgs());
+
+        //    //Assert.AreEqual(@"C:\lucene-temp", output.Args[0]);
+        //    //Assert.True(output.Args.Contains("-crossCheckTermVectors"));
+        //    //Assert.True(output.Args.Contains("-verbose"));
+        //    //Assert.AreEqual("SimpleFSDirectory", output.Args.OptionValue("-dir-impl"));
+        //    //Assert.True(new HashSet<string>(output.Args.OptionValues("-segment")).SetEquals(new HashSet<string>(new string[] { "_seg1", "_seg2", "_seg3" })));
+        //    //Assert.False(output.Args.Contains("-fix"));
+        //}
+
+        //[Test]
+        //public void TestAllOptionsLong()
+        //{
+        //    AssertCommandTranslation(
+        //        @"C:\lucene-temp --verbose --cross-check-term-vectors --directory-type SimpleFSDirectory --segment _seg1 --segment _seg2 --segment _seg3",
+        //        new string[] {
+        //            @"C:\lucene-temp", "-crossCheckTermVectors", "-verbose",
+        //            "-segment", "_seg1", "-segment", "_seg2", "-segment", "_seg3",
+        //            "-dir-impl", "SimpleFSDirectory"
+        //        });
+        //}
+
+        /// <summary>
+        /// Ensures the current working directory is used when index directory is not supplied. 
+        /// </summary>
+        [Test]
+        public void TestNoArguments()
+        {
+            System.IO.Directory.SetCurrentDirectory(@"C:\");
+            AssertCommandTranslation("", new string[] { @"C:\" });
+        }
+
+        
+    }
+}

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/9e389540/src/tools/Lucene.Net.Tests.Cli/Commands/Index/IndexCommandTest.cs
----------------------------------------------------------------------
diff --git a/src/tools/Lucene.Net.Tests.Cli/Commands/Index/IndexCommandTest.cs b/src/tools/Lucene.Net.Tests.Cli/Commands/Index/IndexCommandTest.cs
new file mode 100644
index 0000000..e110667
--- /dev/null
+++ b/src/tools/Lucene.Net.Tests.Cli/Commands/Index/IndexCommandTest.cs
@@ -0,0 +1,56 @@
+using Lucene.Net.Cli.CommandLine;
+using NUnit.Framework;
+using System.Collections.Generic;
+
+namespace Lucene.Net.Cli.Commands
+{
+    /*
+     * Licensed to the Apache Software Foundation (ASF) under one or more
+     * contributor license agreements.  See the NOTICE file distributed with
+     * this work for additional information regarding copyright ownership.
+     * The ASF licenses this file to You under the Apache License, Version 2.0
+     * (the "License"); you may not use this file except in compliance with
+     * the License.  You may obtain a copy of the License at
+     *
+     *     http://www.apache.org/licenses/LICENSE-2.0
+     *
+     * Unless required by applicable law or agreed to in writing, software
+     * distributed under the License is distributed on an "AS IS" BASIS,
+     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     * See the License for the specific language governing permissions and
+     * limitations under the License.
+     */
+
+    public class IndexCommandTest : CommandTestCase
+    {
+        protected override ConfigurationBase CreateConfiguration(MockConsoleApp app)
+        {
+            return new IndexCommand.Configuration(new CommandLineOptions());
+        }
+
+        protected override IList<Arg[]> GetOptionalArgs()
+        {
+            return new List<Arg[]>();
+        }
+
+        protected override IList<Arg[]> GetRequiredArgs()
+        {
+            return new List<Arg[]>();
+        }
+
+        /// <summary>
+        /// Ensures the current working directory is used when index directory is not supplied. 
+        /// </summary>
+        [Test]
+        public void TestNoArguments()
+        {
+            AssertConsoleOutput("", "Lucene.Net Command Line Utility, Version");
+        }
+
+        [Test]
+        public void TestTooManyArguments()
+        {
+            Assert.Throws<CommandParsingException>(() => AssertConsoleOutput("one", ""));
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/9e389540/src/tools/Lucene.Net.Tests.Cli/Commands/Index/IndexCopySegmentsTest.cs
----------------------------------------------------------------------
diff --git a/src/tools/Lucene.Net.Tests.Cli/Commands/Index/IndexCopySegmentsTest.cs b/src/tools/Lucene.Net.Tests.Cli/Commands/Index/IndexCopySegmentsTest.cs
new file mode 100644
index 0000000..68b86c0
--- /dev/null
+++ b/src/tools/Lucene.Net.Tests.Cli/Commands/Index/IndexCopySegmentsTest.cs
@@ -0,0 +1,58 @@
+using NUnit.Framework;
+using System.Collections.Generic;
+
+namespace Lucene.Net.Cli.Commands
+{
+    /*
+     * Licensed to the Apache Software Foundation (ASF) under one or more
+     * contributor license agreements.  See the NOTICE file distributed with
+     * this work for additional information regarding copyright ownership.
+     * The ASF licenses this file to You under the Apache License, Version 2.0
+     * (the "License"); you may not use this file except in compliance with
+     * the License.  You may obtain a copy of the License at
+     *
+     *     http://www.apache.org/licenses/LICENSE-2.0
+     *
+     * Unless required by applicable law or agreed to in writing, software
+     * distributed under the License is distributed on an "AS IS" BASIS,
+     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     * See the License for the specific language governing permissions and
+     * limitations under the License.
+     */
+
+    public class IndexCopySegmentsTest : CommandTestCase
+    {
+        protected override ConfigurationBase CreateConfiguration(MockConsoleApp app)
+        {
+            return new IndexCopySegmentsCommand.Configuration(new CommandLineOptions()) { Main = (args) => app.Main(args) };
+        }
+
+        protected override IList<Arg[]> GetOptionalArgs()
+        {
+            return new List<Arg[]>();
+        }
+
+        protected override IList<Arg[]> GetRequiredArgs()
+        {
+            // NOTE: We must order this in the sequence of the expected output.
+            return new List<Arg[]>()
+            {
+                new Arg[] { new Arg(inputPattern: @"C:\lucene-temp", output: new string[] { @"C:\lucene-temp" }) },
+                new Arg[] { new Arg(inputPattern: @"C:\lucene-temp2", output: new string[] { @"C:\lucene-temp2" }) },
+                new Arg[] {
+                    new Arg(inputPattern: "_seg1", output: new string[] { "_seg1" }),
+                    new Arg(inputPattern: "_seg1 _seg2", output: new string[] { "_seg1", "_seg2" }),
+                    new Arg(inputPattern: "_seg1 _seg2 _seg3", output: new string[] { "_seg1", "_seg2", "_seg3" }),
+                    new Arg(inputPattern: "_seg1 _seg2 _seg3 _seg4", output: new string[] { "_seg1", "_seg2", "_seg3", "_seg4" }),
+                },
+            };
+        }
+
+        [Test]
+        public void TestNotEnoughArguments()
+        {
+            Assert.NotNull(FromResource("NotEnoughArguments"));
+            AssertConsoleOutput("one two", FromResource("NotEnoughArguments", 3));
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/9e389540/src/tools/Lucene.Net.Tests.Cli/Commands/Index/IndexDeleteSegmentsCommandTest.cs
----------------------------------------------------------------------
diff --git a/src/tools/Lucene.Net.Tests.Cli/Commands/Index/IndexDeleteSegmentsCommandTest.cs b/src/tools/Lucene.Net.Tests.Cli/Commands/Index/IndexDeleteSegmentsCommandTest.cs
new file mode 100644
index 0000000..42a2632
--- /dev/null
+++ b/src/tools/Lucene.Net.Tests.Cli/Commands/Index/IndexDeleteSegmentsCommandTest.cs
@@ -0,0 +1,58 @@
+using NUnit.Framework;
+using System.Collections.Generic;
+
+namespace Lucene.Net.Cli.Commands
+{
+    /*
+     * Licensed to the Apache Software Foundation (ASF) under one or more
+     * contributor license agreements.  See the NOTICE file distributed with
+     * this work for additional information regarding copyright ownership.
+     * The ASF licenses this file to You under the Apache License, Version 2.0
+     * (the "License"); you may not use this file except in compliance with
+     * the License.  You may obtain a copy of the License at
+     *
+     *     http://www.apache.org/licenses/LICENSE-2.0
+     *
+     * Unless required by applicable law or agreed to in writing, software
+     * distributed under the License is distributed on an "AS IS" BASIS,
+     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     * See the License for the specific language governing permissions and
+     * limitations under the License.
+     */
+
+    public class IndexDeleteSegmentsCommandTest : CommandTestCase
+    {
+        protected override ConfigurationBase CreateConfiguration(MockConsoleApp app)
+        {
+            return new IndexDeleteSegmentsCommand.Configuration(new CommandLineOptions()) { Main = (args) => app.Main(args) };
+        }
+
+        protected override IList<Arg[]> GetOptionalArgs()
+        {
+            return new List<Arg[]>();
+        }
+
+        protected override IList<Arg[]> GetRequiredArgs()
+        {
+            // NOTE: We must order this in the sequence of the expected output.
+            return new List<Arg[]>()
+            {
+                new Arg[] { new Arg(inputPattern: @"C:\lucene-temp", output: new string[] { @"C:\lucene-temp" }) },
+                new Arg[] {
+                    new Arg(inputPattern: "_seg1", output: new string[] { "_seg1" }),
+                    new Arg(inputPattern: "_seg1 _seg2", output: new string[] { "_seg1", "_seg2" }),
+                    new Arg(inputPattern: "_seg1 _seg2 _seg3", output: new string[] { "_seg1", "_seg2", "_seg3" }),
+                    new Arg(inputPattern: "_seg1 _seg2 _seg3 _seg4", output: new string[] { "_seg1", "_seg2", "_seg3", "_seg4" }),
+                },
+                new Arg[] { new Arg(inputPattern: "", output: new string[] { "-d"}) }
+            };
+        }
+
+        [Test]
+        public void TestNotEnoughArguments()
+        {
+            Assert.NotNull(FromResource("NotEnoughArguments"));
+            AssertConsoleOutput("one", FromResource("NotEnoughArguments", 2));
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/9e389540/src/tools/Lucene.Net.Tests.Cli/Commands/Index/IndexExtractCfsCommandTest.cs
----------------------------------------------------------------------
diff --git a/src/tools/Lucene.Net.Tests.Cli/Commands/Index/IndexExtractCfsCommandTest.cs b/src/tools/Lucene.Net.Tests.Cli/Commands/Index/IndexExtractCfsCommandTest.cs
new file mode 100644
index 0000000..a8ecd92
--- /dev/null
+++ b/src/tools/Lucene.Net.Tests.Cli/Commands/Index/IndexExtractCfsCommandTest.cs
@@ -0,0 +1,56 @@
+using NUnit.Framework;
+using System.Collections.Generic;
+
+namespace Lucene.Net.Cli.Commands
+{
+    /*
+     * Licensed to the Apache Software Foundation (ASF) under one or more
+     * contributor license agreements.  See the NOTICE file distributed with
+     * this work for additional information regarding copyright ownership.
+     * The ASF licenses this file to You under the Apache License, Version 2.0
+     * (the "License"); you may not use this file except in compliance with
+     * the License.  You may obtain a copy of the License at
+     *
+     *     http://www.apache.org/licenses/LICENSE-2.0
+     *
+     * Unless required by applicable law or agreed to in writing, software
+     * distributed under the License is distributed on an "AS IS" BASIS,
+     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     * See the License for the specific language governing permissions and
+     * limitations under the License.
+     */
+
+    public class IndexExtractCfsCommandTest : CommandTestCase
+    {
+        protected override ConfigurationBase CreateConfiguration(MockConsoleApp app)
+        {
+            return new IndexExtractCfsCommand.Configuration(new CommandLineOptions()) { Main = (args) => app.Main(args) };
+        }
+
+        protected override IList<Arg[]> GetOptionalArgs()
+        {
+            // NOTE: We must order this in the sequence of the expected output.
+            return new List<Arg[]>()
+            {
+                new Arg[] { new Arg(inputPattern: "-dir SimpleFSDirectory|--directory-type SimpleFSDirectory", output: new string[] { "-dir-impl", "SimpleFSDirectory" }) },
+            };
+        }
+
+        protected override IList<Arg[]> GetRequiredArgs()
+        {
+            // NOTE: We must order this in the sequence of the expected output.
+            return new List<Arg[]>()
+            {
+                new Arg[] { new Arg(inputPattern: @"C:\lucene-temp", output: new string[] { @"C:\lucene-temp" }) },
+                new Arg[] { new Arg(inputPattern: "", output: new string[] { "-extract" }) },
+            };
+        }
+
+        [Test]
+        public void TestNotEnoughArguments()
+        {
+            Assert.NotNull(FromResource("NotEnoughArguments"));
+            AssertConsoleOutput("", FromResource("NotEnoughArguments", 1));
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/9e389540/src/tools/Lucene.Net.Tests.Cli/Commands/Index/IndexFixCommandTest.cs
----------------------------------------------------------------------
diff --git a/src/tools/Lucene.Net.Tests.Cli/Commands/Index/IndexFixCommandTest.cs b/src/tools/Lucene.Net.Tests.Cli/Commands/Index/IndexFixCommandTest.cs
new file mode 100644
index 0000000..105606d
--- /dev/null
+++ b/src/tools/Lucene.Net.Tests.Cli/Commands/Index/IndexFixCommandTest.cs
@@ -0,0 +1,70 @@
+using Lucene.Net.Cli.CommandLine;
+using NUnit.Framework;
+using System.Collections.Generic;
+
+namespace Lucene.Net.Cli.Commands
+{
+    /*
+     * Licensed to the Apache Software Foundation (ASF) under one or more
+     * contributor license agreements.  See the NOTICE file distributed with
+     * this work for additional information regarding copyright ownership.
+     * The ASF licenses this file to You under the Apache License, Version 2.0
+     * (the "License"); you may not use this file except in compliance with
+     * the License.  You may obtain a copy of the License at
+     *
+     *     http://www.apache.org/licenses/LICENSE-2.0
+     *
+     * Unless required by applicable law or agreed to in writing, software
+     * distributed under the License is distributed on an "AS IS" BASIS,
+     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     * See the License for the specific language governing permissions and
+     * limitations under the License.
+     */
+
+    public class IndexFixCommandTest : CommandTestCase
+    {
+        protected override ConfigurationBase CreateConfiguration(MockConsoleApp app)
+        {
+            return new IndexFixCommand.Configuration(new CommandLineOptions()) { Main = (args) => app.Main(args) };
+        }
+
+        protected override IList<Arg[]> GetOptionalArgs()
+        {
+            // NOTE: We must order this in the sequence of the expected output.
+            return new List<Arg[]>()
+            {
+                new Arg[] { new Arg(inputPattern: "-c|--cross-check-term-vectors", output: new string[] { "-crossCheckTermVectors" }) },
+                new Arg[] { new Arg(inputPattern: "--verbose", output: new string[] { "-verbose" }) },
+                new Arg[] {
+                    new Arg(inputPattern: "-s _seg1|--segment _seg1", output: new string[] { "-segment", "_seg1" }),
+                    new Arg(inputPattern: "-s _seg1 -s _seg2|--segment _seg1 --segment _seg2", output: new string[] { "-segment", "_seg1", "-segment", "_seg2" }),
+                    new Arg(inputPattern: "-s _seg1 -s _seg2 -s _seg3|--segment _seg1 --segment _seg2 --segment _seg3", output: new string[] { "-segment", "_seg1", "-segment", "_seg2", "-segment", "_seg3" })
+                },
+                new Arg[] { new Arg(inputPattern: "-dir SimpleFSDirectory|--directory-type SimpleFSDirectory", output: new string[] { "-dir-impl", "SimpleFSDirectory" }) },
+            };
+        }
+
+        protected override IList<Arg[]> GetRequiredArgs()
+        {
+            // NOTE: We must order this in the sequence of the expected output.
+            return new List<Arg[]>()
+            {
+                new Arg[] { new Arg(inputPattern: @"C:\lucene-temp", output: new string[] { @"C:\lucene-temp" }) },
+                new Arg[] { new Arg(inputPattern: "", output: new string[] { "-fix" }) },
+            };
+        }
+
+        [Test]
+        public void TestNoArguments()
+        {
+            System.IO.Directory.SetCurrentDirectory(@"C:\");
+            AssertCommandTranslation("", new string[] { @"C:\", "-fix" });
+        }
+
+        [Test]
+        public void TestTooManyArguments()
+        {
+            Assert.Throws<CommandParsingException>(() => AssertConsoleOutput("one two", ""));
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/9e389540/src/tools/Lucene.Net.Tests.Cli/Commands/Index/IndexListCfsCommandTest.cs
----------------------------------------------------------------------
diff --git a/src/tools/Lucene.Net.Tests.Cli/Commands/Index/IndexListCfsCommandTest.cs b/src/tools/Lucene.Net.Tests.Cli/Commands/Index/IndexListCfsCommandTest.cs
new file mode 100644
index 0000000..46b014c
--- /dev/null
+++ b/src/tools/Lucene.Net.Tests.Cli/Commands/Index/IndexListCfsCommandTest.cs
@@ -0,0 +1,69 @@
+using Lucene.Net.Cli.CommandLine;
+using NUnit.Framework;
+using System.Collections.Generic;
+
+namespace Lucene.Net.Cli.Commands
+{
+    /*
+     * Licensed to the Apache Software Foundation (ASF) under one or more
+     * contributor license agreements.  See the NOTICE file distributed with
+     * this work for additional information regarding copyright ownership.
+     * The ASF licenses this file to You under the Apache License, Version 2.0
+     * (the "License"); you may not use this file except in compliance with
+     * the License.  You may obtain a copy of the License at
+     *
+     *     http://www.apache.org/licenses/LICENSE-2.0
+     *
+     * Unless required by applicable law or agreed to in writing, software
+     * distributed under the License is distributed on an "AS IS" BASIS,
+     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     * See the License for the specific language governing permissions and
+     * limitations under the License.
+     */
+
+    public class IndexListCfsCommandTest : CommandTestCase
+    {
+        
+        protected override ConfigurationBase CreateConfiguration(MockConsoleApp app)
+        {
+            return new IndexListCfsCommand.Configuration(new CommandLineOptions()) { Main = (args) => app.Main(args) };
+        }
+
+        protected override IList<Arg[]> GetOptionalArgs()
+        {
+            // NOTE: We must order this in the sequence of the expected output.
+            return new List<Arg[]>()
+            {
+                new Arg[] { new Arg(inputPattern: "-dir SimpleFSDirectory|--directory-type SimpleFSDirectory", output: new string[] { "-dir-impl", "SimpleFSDirectory" }) },
+            };
+        }
+
+        protected override IList<Arg[]> GetRequiredArgs()
+        {
+            // NOTE: We must order this in the sequence of the expected output.
+            return new List<Arg[]>()
+            {
+                new Arg[] { new Arg(inputPattern: @"C:\lucene-temp", output: new string[] { @"C:\lucene-temp" }) },
+            };
+        }
+
+        [Test]
+        public void TestNotEnoughArguments()
+        {
+            Assert.NotNull(FromResource("NotEnoughArguments"));
+            AssertConsoleOutput("", FromResource("NotEnoughArguments", 1));
+        }
+
+        [Test]
+        public void TestTooManyArguments()
+        {
+            Assert.Throws<CommandParsingException>(() => AssertConsoleOutput("one two", ""));
+        }
+
+        [Test]
+        public override void TestHelp()
+        {
+            base.TestHelp();
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/9e389540/src/tools/Lucene.Net.Tests.Cli/Commands/Index/IndexListHighFreqTermsCommandTest.cs
----------------------------------------------------------------------
diff --git a/src/tools/Lucene.Net.Tests.Cli/Commands/Index/IndexListHighFreqTermsCommandTest.cs b/src/tools/Lucene.Net.Tests.Cli/Commands/Index/IndexListHighFreqTermsCommandTest.cs
new file mode 100644
index 0000000..fc937ad
--- /dev/null
+++ b/src/tools/Lucene.Net.Tests.Cli/Commands/Index/IndexListHighFreqTermsCommandTest.cs
@@ -0,0 +1,67 @@
+using Lucene.Net.Cli.CommandLine;
+using NUnit.Framework;
+using System.Collections.Generic;
+
+namespace Lucene.Net.Cli.Commands
+{
+    /*
+     * Licensed to the Apache Software Foundation (ASF) under one or more
+     * contributor license agreements.  See the NOTICE file distributed with
+     * this work for additional information regarding copyright ownership.
+     * The ASF licenses this file to You under the Apache License, Version 2.0
+     * (the "License"); you may not use this file except in compliance with
+     * the License.  You may obtain a copy of the License at
+     *
+     *     http://www.apache.org/licenses/LICENSE-2.0
+     *
+     * Unless required by applicable law or agreed to in writing, software
+     * distributed under the License is distributed on an "AS IS" BASIS,
+     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     * See the License for the specific language governing permissions and
+     * limitations under the License.
+     */
+
+    public class IndexListHighFreqTermsCommandTest : CommandTestCase
+    {
+        protected override ConfigurationBase CreateConfiguration(MockConsoleApp app)
+        {
+            return new IndexListHighFreqTermsCommand.Configuration(new CommandLineOptions()) { Main = (args) => app.Main(args) };
+        }
+
+        protected override IList<Arg[]> GetOptionalArgs()
+        {
+            // NOTE: We must order this in the sequence of the expected output.
+            return new List<Arg[]>()
+            {
+                new Arg[] { new Arg(inputPattern: "-t|--total-term-frequency", output: new string[] { "-t" }) },
+                new Arg[] { new Arg(inputPattern: "-n 20|--number-of-terms 20", output: new string[] { "20" }) },
+                new Arg[] { new Arg(inputPattern: "-f fieldName|--field fieldName", output: new string[] { "fieldName" }) },
+            };
+        }
+
+        protected override IList<Arg[]> GetRequiredArgs()
+        {
+            // NOTE: We must order this in the sequence of the expected output.
+            return new List<Arg[]>()
+            {
+                new Arg[] { new Arg(inputPattern: @"C:\lucene-temp", output: new string[] { @"C:\lucene-temp" }) },
+            };
+        }
+
+        /// <summary>
+        /// Ensures the current working directory is used when index directory is not supplied. 
+        /// </summary>
+        [Test]
+        public void TestNoArguments()
+        {
+            System.IO.Directory.SetCurrentDirectory(@"C:\");
+            AssertCommandTranslation("", new string[] { @"C:\" });
+        }
+
+        [Test]
+        public void TestTooManyArguments()
+        {
+            Assert.Throws<CommandParsingException>(() => AssertConsoleOutput("one two", ""));
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/9e389540/src/tools/Lucene.Net.Tests.Cli/Commands/Index/IndexListSegmentsCommandTest.cs
----------------------------------------------------------------------
diff --git a/src/tools/Lucene.Net.Tests.Cli/Commands/Index/IndexListSegmentsCommandTest.cs b/src/tools/Lucene.Net.Tests.Cli/Commands/Index/IndexListSegmentsCommandTest.cs
new file mode 100644
index 0000000..c4297c7
--- /dev/null
+++ b/src/tools/Lucene.Net.Tests.Cli/Commands/Index/IndexListSegmentsCommandTest.cs
@@ -0,0 +1,63 @@
+using Lucene.Net.Cli.CommandLine;
+using NUnit.Framework;
+using System.Collections.Generic;
+
+namespace Lucene.Net.Cli.Commands
+{
+    /*
+     * Licensed to the Apache Software Foundation (ASF) under one or more
+     * contributor license agreements.  See the NOTICE file distributed with
+     * this work for additional information regarding copyright ownership.
+     * The ASF licenses this file to You under the Apache License, Version 2.0
+     * (the "License"); you may not use this file except in compliance with
+     * the License.  You may obtain a copy of the License at
+     *
+     *     http://www.apache.org/licenses/LICENSE-2.0
+     *
+     * Unless required by applicable law or agreed to in writing, software
+     * distributed under the License is distributed on an "AS IS" BASIS,
+     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     * See the License for the specific language governing permissions and
+     * limitations under the License.
+     */
+
+    public class IndexListSegmentsCommandTest : CommandTestCase
+    {
+        protected override ConfigurationBase CreateConfiguration(MockConsoleApp app)
+        {
+            return new IndexListSegmentsCommand.Configuration(new CommandLineOptions()) { Main = (args) => app.Main(args) };
+        }
+
+        protected override IList<Arg[]> GetOptionalArgs()
+        {
+            // NOTE: We must order this in the sequence of the expected output.
+            return new List<Arg[]>();
+        }
+
+        protected override IList<Arg[]> GetRequiredArgs()
+        {
+            // NOTE: We must order this in the sequence of the expected output.
+            return new List<Arg[]>()
+            {
+                new Arg[] { new Arg(inputPattern: @"C:\lucene-temp", output: new string[] { @"C:\lucene-temp" }) },
+                new Arg[] { new Arg(inputPattern: "", output: new string[] { "-l" }) },
+            };
+        }
+
+        /// <summary>
+        /// Ensures the current working directory is used when index directory is not supplied. 
+        /// </summary>
+        [Test]
+        public void TestNoArguments()
+        {
+            System.IO.Directory.SetCurrentDirectory(@"C:\");
+            AssertCommandTranslation("", new string[] { @"C:\", "-l" });
+        }
+
+        [Test]
+        public void TestTooManyArguments()
+        {
+            Assert.Throws<CommandParsingException>(() => AssertConsoleOutput("one two", ""));
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/9e389540/src/tools/Lucene.Net.Tests.Cli/Commands/Index/IndexListTaxonomyStatsCommandTest.cs
----------------------------------------------------------------------
diff --git a/src/tools/Lucene.Net.Tests.Cli/Commands/Index/IndexListTaxonomyStatsCommandTest.cs b/src/tools/Lucene.Net.Tests.Cli/Commands/Index/IndexListTaxonomyStatsCommandTest.cs
new file mode 100644
index 0000000..8539200
--- /dev/null
+++ b/src/tools/Lucene.Net.Tests.Cli/Commands/Index/IndexListTaxonomyStatsCommandTest.cs
@@ -0,0 +1,65 @@
+using Lucene.Net.Cli.CommandLine;
+using NUnit.Framework;
+using System.Collections.Generic;
+
+namespace Lucene.Net.Cli.Commands
+{
+    /*
+     * Licensed to the Apache Software Foundation (ASF) under one or more
+     * contributor license agreements.  See the NOTICE file distributed with
+     * this work for additional information regarding copyright ownership.
+     * The ASF licenses this file to You under the Apache License, Version 2.0
+     * (the "License"); you may not use this file except in compliance with
+     * the License.  You may obtain a copy of the License at
+     *
+     *     http://www.apache.org/licenses/LICENSE-2.0
+     *
+     * Unless required by applicable law or agreed to in writing, software
+     * distributed under the License is distributed on an "AS IS" BASIS,
+     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     * See the License for the specific language governing permissions and
+     * limitations under the License.
+     */
+
+    public class IndexListTaxonomyStatsCommandTest : CommandTestCase
+    {
+        protected override ConfigurationBase CreateConfiguration(MockConsoleApp app)
+        {
+            return new IndexListTaxonomyStatsCommand.Configuration(new CommandLineOptions()) { Main = (args) => app.Main(args) };
+        }
+
+        protected override IList<Arg[]> GetOptionalArgs()
+        {
+            // NOTE: We must order this in the sequence of the expected output.
+            return new List<Arg[]>()
+            {
+                new Arg[] { new Arg(inputPattern: "-tree|--show-tree", output: new string[] { "-printTree" }) },
+            };
+        }
+
+        protected override IList<Arg[]> GetRequiredArgs()
+        {
+            // NOTE: We must order this in the sequence of the expected output.
+            return new List<Arg[]>()
+            {
+                new Arg[] { new Arg(inputPattern: @"C:\lucene-temp", output: new string[] { @"C:\lucene-temp" }) },
+            };
+        }
+
+        /// <summary>
+        /// Ensures the current working directory is used when index directory is not supplied. 
+        /// </summary>
+        [Test]
+        public void TestNoArguments()
+        {
+            System.IO.Directory.SetCurrentDirectory(@"C:\");
+            AssertCommandTranslation("", new string[] { @"C:\" });
+        }
+
+        [Test]
+        public void TestTooManyArguments()
+        {
+            Assert.Throws<CommandParsingException>(() => AssertConsoleOutput("one two", ""));
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/9e389540/src/tools/Lucene.Net.Tests.Cli/Commands/Index/IndexListTermInfoCommandTest.cs
----------------------------------------------------------------------
diff --git a/src/tools/Lucene.Net.Tests.Cli/Commands/Index/IndexListTermInfoCommandTest.cs b/src/tools/Lucene.Net.Tests.Cli/Commands/Index/IndexListTermInfoCommandTest.cs
new file mode 100644
index 0000000..09a536a
--- /dev/null
+++ b/src/tools/Lucene.Net.Tests.Cli/Commands/Index/IndexListTermInfoCommandTest.cs
@@ -0,0 +1,61 @@
+using Lucene.Net.Cli.CommandLine;
+using NUnit.Framework;
+using System.Collections.Generic;
+
+namespace Lucene.Net.Cli.Commands
+{
+    /*
+     * Licensed to the Apache Software Foundation (ASF) under one or more
+     * contributor license agreements.  See the NOTICE file distributed with
+     * this work for additional information regarding copyright ownership.
+     * The ASF licenses this file to You under the Apache License, Version 2.0
+     * (the "License"); you may not use this file except in compliance with
+     * the License.  You may obtain a copy of the License at
+     *
+     *     http://www.apache.org/licenses/LICENSE-2.0
+     *
+     * Unless required by applicable law or agreed to in writing, software
+     * distributed under the License is distributed on an "AS IS" BASIS,
+     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     * See the License for the specific language governing permissions and
+     * limitations under the License.
+     */
+
+    public class IndexListTermInfoCommandTest : CommandTestCase
+    {
+        protected override ConfigurationBase CreateConfiguration(MockConsoleApp app)
+        {
+            return new IndexListTermInfoCommand.Configuration(new CommandLineOptions()) { Main = (args) => app.Main(args) };
+        }
+
+        protected override IList<Arg[]> GetOptionalArgs()
+        {
+            // NOTE: We must order this in the sequence of the expected output.
+            return new List<Arg[]>();
+        }
+
+        protected override IList<Arg[]> GetRequiredArgs()
+        {
+            // NOTE: We must order this in the sequence of the expected output.
+            return new List<Arg[]>()
+            {
+                new Arg[] { new Arg(inputPattern: @"C:\lucene-temp", output: new string[] { @"C:\lucene-temp" }) },
+                new Arg[] { new Arg(inputPattern: "fieldName", output: new string[] { "fieldName" }) },
+                new Arg[] { new Arg(inputPattern: "termName", output: new string[] { "termName" }) },
+            };
+        }
+
+        [Test]
+        public void TestNotEnoughArguments()
+        {
+            Assert.NotNull(FromResource("NotEnoughArguments"));
+            AssertConsoleOutput("", FromResource("NotEnoughArguments", 3));
+        }
+
+        [Test]
+        public void TestTooManyArguments()
+        {
+            Assert.Throws<CommandParsingException>(() => AssertConsoleOutput("one two three four", ""));
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/9e389540/src/tools/Lucene.Net.Tests.Cli/Commands/Index/IndexMergeCommandTest.cs
----------------------------------------------------------------------
diff --git a/src/tools/Lucene.Net.Tests.Cli/Commands/Index/IndexMergeCommandTest.cs b/src/tools/Lucene.Net.Tests.Cli/Commands/Index/IndexMergeCommandTest.cs
new file mode 100644
index 0000000..f425eab
--- /dev/null
+++ b/src/tools/Lucene.Net.Tests.Cli/Commands/Index/IndexMergeCommandTest.cs
@@ -0,0 +1,57 @@
+using NUnit.Framework;
+using System.Collections.Generic;
+
+namespace Lucene.Net.Cli.Commands
+{
+    /*
+     * Licensed to the Apache Software Foundation (ASF) under one or more
+     * contributor license agreements.  See the NOTICE file distributed with
+     * this work for additional information regarding copyright ownership.
+     * The ASF licenses this file to You under the Apache License, Version 2.0
+     * (the "License"); you may not use this file except in compliance with
+     * the License.  You may obtain a copy of the License at
+     *
+     *     http://www.apache.org/licenses/LICENSE-2.0
+     *
+     * Unless required by applicable law or agreed to in writing, software
+     * distributed under the License is distributed on an "AS IS" BASIS,
+     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     * See the License for the specific language governing permissions and
+     * limitations under the License.
+     */
+
+    public class IndexMergeCommandTest : CommandTestCase
+    {
+        protected override ConfigurationBase CreateConfiguration(MockConsoleApp app)
+        {
+            return new IndexMergeCommand.Configuration(new CommandLineOptions()) { Main = (args) => app.Main(args) };
+        }
+
+        protected override IList<Arg[]> GetOptionalArgs()
+        {
+            // NOTE: We must order this in the sequence of the expected output.
+            return new List<Arg[]>();
+        }
+
+        protected override IList<Arg[]> GetRequiredArgs()
+        {
+            // NOTE: We must order this in the sequence of the expected output.
+            return new List<Arg[]>()
+            {
+                new Arg[] { new Arg(inputPattern: @"C:\lucene-temp", output: new string[] { @"C:\lucene-temp" }) },
+                new Arg[] {
+                    new Arg(inputPattern: @"C:\lucene-temp2 C:\lucene-temp3", output: new string[] { @"C:\lucene-temp2", @"C:\lucene-temp3" }),
+                    new Arg(inputPattern: @"C:\lucene-temp2 C:\lucene-temp3 C:\lucene-temp4", output: new string[] { @"C:\lucene-temp2", @"C:\lucene-temp3", @"C:\lucene-temp4" }),
+                    new Arg(inputPattern: @"C:\lucene-temp2 C:\lucene-temp3 C:\lucene-temp4 C:\lucene-temp5", output: new string[] { @"C:\lucene-temp2", @"C:\lucene-temp3", @"C:\lucene-temp4", @"C:\lucene-temp5" }),
+                },
+            };
+        }
+
+        [Test]
+        public void TestNotEnoughArguments()
+        {
+            Assert.NotNull(FromResource("NotEnoughArguments"));
+            AssertConsoleOutput("", FromResource("NotEnoughArguments", 3));
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/9e389540/src/tools/Lucene.Net.Tests.Cli/Commands/Index/IndexSplitCommandTest.cs
----------------------------------------------------------------------
diff --git a/src/tools/Lucene.Net.Tests.Cli/Commands/Index/IndexSplitCommandTest.cs b/src/tools/Lucene.Net.Tests.Cli/Commands/Index/IndexSplitCommandTest.cs
new file mode 100644
index 0000000..bf0ef31
--- /dev/null
+++ b/src/tools/Lucene.Net.Tests.Cli/Commands/Index/IndexSplitCommandTest.cs
@@ -0,0 +1,62 @@
+using NUnit.Framework;
+using System.Collections.Generic;
+
+namespace Lucene.Net.Cli.Commands
+{
+    /*
+     * Licensed to the Apache Software Foundation (ASF) under one or more
+     * contributor license agreements.  See the NOTICE file distributed with
+     * this work for additional information regarding copyright ownership.
+     * The ASF licenses this file to You under the Apache License, Version 2.0
+     * (the "License"); you may not use this file except in compliance with
+     * the License.  You may obtain a copy of the License at
+     *
+     *     http://www.apache.org/licenses/LICENSE-2.0
+     *
+     * Unless required by applicable law or agreed to in writing, software
+     * distributed under the License is distributed on an "AS IS" BASIS,
+     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     * See the License for the specific language governing permissions and
+     * limitations under the License.
+     */
+
+    public class IndexSplitCommandTest : CommandTestCase
+    {
+        protected override ConfigurationBase CreateConfiguration(MockConsoleApp app)
+        {
+            return new IndexSplitCommand.Configuration(new CommandLineOptions()) { Main = (args) => app.Main(args) };
+        }
+
+        protected override IList<Arg[]> GetOptionalArgs()
+        {
+            // NOTE: We must order this in the sequence of the expected output.
+            return new List<Arg[]>()
+            {
+                new Arg[] { new Arg(inputPattern: "-n 20|--number-of-parts 20", output: new string[] { "-num", "20" }) },
+                new Arg[] { new Arg(inputPattern: "-s|--sequential", output: new string[] { "-seq" }) },
+            };
+        }
+
+        protected override IList<Arg[]> GetRequiredArgs()
+        {
+            // NOTE: We must order this in the sequence of the expected output.
+            return new List<Arg[]>()
+            {
+                new Arg[] { new Arg(inputPattern: @"C:\lucene-temp", output: new string[] { /*"-out", @"C:\lucene-temp"*/ }) },
+                new Arg[] {
+                    new Arg(inputPattern: @"C:\lucene-temp2 C:\lucene-temp3", output: new string[] { @"C:\lucene-temp2", @"C:\lucene-temp3" }),
+                    new Arg(inputPattern: @"C:\lucene-temp2 C:\lucene-temp3 C:\lucene-temp4", output: new string[] { @"C:\lucene-temp2", @"C:\lucene-temp3", @"C:\lucene-temp4" }),
+                    new Arg(inputPattern: @"C:\lucene-temp2 C:\lucene-temp3 C:\lucene-temp4 C:\lucene-temp5", output: new string[] { @"C:\lucene-temp2", @"C:\lucene-temp3", @"C:\lucene-temp4", @"C:\lucene-temp5" }),
+                },
+                new Arg[] { new Arg(inputPattern: "", output: new string[] { "-out", @"C:\lucene-temp" }) },
+            };
+        }
+
+        [Test]
+        public void TestNotEnoughArguments()
+        {
+            Assert.NotNull(FromResource("NotEnoughArguments"));
+            AssertConsoleOutput("", FromResource("NotEnoughArguments", 2));
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/9e389540/src/tools/Lucene.Net.Tests.Cli/Commands/Index/IndexUpgradeCommandTest.cs
----------------------------------------------------------------------
diff --git a/src/tools/Lucene.Net.Tests.Cli/Commands/Index/IndexUpgradeCommandTest.cs b/src/tools/Lucene.Net.Tests.Cli/Commands/Index/IndexUpgradeCommandTest.cs
new file mode 100644
index 0000000..9b52235
--- /dev/null
+++ b/src/tools/Lucene.Net.Tests.Cli/Commands/Index/IndexUpgradeCommandTest.cs
@@ -0,0 +1,67 @@
+using Lucene.Net.Cli.CommandLine;
+using NUnit.Framework;
+using System.Collections.Generic;
+
+namespace Lucene.Net.Cli.Commands
+{
+    /*
+     * Licensed to the Apache Software Foundation (ASF) under one or more
+     * contributor license agreements.  See the NOTICE file distributed with
+     * this work for additional information regarding copyright ownership.
+     * The ASF licenses this file to You under the Apache License, Version 2.0
+     * (the "License"); you may not use this file except in compliance with
+     * the License.  You may obtain a copy of the License at
+     *
+     *     http://www.apache.org/licenses/LICENSE-2.0
+     *
+     * Unless required by applicable law or agreed to in writing, software
+     * distributed under the License is distributed on an "AS IS" BASIS,
+     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     * See the License for the specific language governing permissions and
+     * limitations under the License.
+     */
+
+    public class IndexUpgradeCommandTest : CommandTestCase
+    {
+        protected override ConfigurationBase CreateConfiguration(MockConsoleApp app)
+        {
+            return new IndexUpgradeCommand.Configuration(new CommandLineOptions()) { Main = (args) => app.Main(args) };
+        }
+
+        protected override IList<Arg[]> GetOptionalArgs()
+        {
+            // NOTE: We must order this in the sequence of the expected output.
+            return new List<Arg[]>()
+            {
+                new Arg[] { new Arg(inputPattern: "-d|--delete-prior-commits", output: new string[] { "-delete-prior-commits" }) },
+                new Arg[] { new Arg(inputPattern: "-v|--verbose", output: new string[] { "-verbose" }) },
+                new Arg[] { new Arg(inputPattern: "-dir SimpleFSDirectory|--directory-type SimpleFSDirectory", output: new string[] { "-dir-impl", "SimpleFSDirectory" }) },
+            };
+        }
+
+        protected override IList<Arg[]> GetRequiredArgs()
+        {
+            // NOTE: We must order this in the sequence of the expected output.
+            return new List<Arg[]>()
+            {
+                new Arg[] { new Arg(inputPattern: @"C:\lucene-temp", output: new string[] { @"C:\lucene-temp" }) },
+            };
+        }
+
+        /// <summary>
+        /// Ensures the current working directory is used when index directory is not supplied. 
+        /// </summary>
+        [Test]
+        public void TestNoArguments()
+        {
+            System.IO.Directory.SetCurrentDirectory(@"C:\");
+            AssertCommandTranslation("", new string[] { @"C:\" });
+        }
+
+        [Test]
+        public void TestTooManyArguments()
+        {
+            Assert.Throws<CommandParsingException>(() => AssertConsoleOutput("one two", ""));
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/9e389540/src/tools/Lucene.Net.Tests.Cli/Commands/Lock/LockCommandTest.cs
----------------------------------------------------------------------
diff --git a/src/tools/Lucene.Net.Tests.Cli/Commands/Lock/LockCommandTest.cs b/src/tools/Lucene.Net.Tests.Cli/Commands/Lock/LockCommandTest.cs
new file mode 100644
index 0000000..d5c1f64
--- /dev/null
+++ b/src/tools/Lucene.Net.Tests.Cli/Commands/Lock/LockCommandTest.cs
@@ -0,0 +1,56 @@
+using Lucene.Net.Cli.CommandLine;
+using NUnit.Framework;
+using System.Collections.Generic;
+
+namespace Lucene.Net.Cli.Commands
+{
+    /*
+     * Licensed to the Apache Software Foundation (ASF) under one or more
+     * contributor license agreements.  See the NOTICE file distributed with
+     * this work for additional information regarding copyright ownership.
+     * The ASF licenses this file to You under the Apache License, Version 2.0
+     * (the "License"); you may not use this file except in compliance with
+     * the License.  You may obtain a copy of the License at
+     *
+     *     http://www.apache.org/licenses/LICENSE-2.0
+     *
+     * Unless required by applicable law or agreed to in writing, software
+     * distributed under the License is distributed on an "AS IS" BASIS,
+     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     * See the License for the specific language governing permissions and
+     * limitations under the License.
+     */
+
+    public class LockCommandTest : CommandTestCase
+    {
+        protected override ConfigurationBase CreateConfiguration(MockConsoleApp app)
+        {
+            return new LockCommand.Configuration(new CommandLineOptions());
+        }
+
+        protected override IList<Arg[]> GetOptionalArgs()
+        {
+            return new List<Arg[]>();
+        }
+
+        protected override IList<Arg[]> GetRequiredArgs()
+        {
+            return new List<Arg[]>();
+        }
+
+        /// <summary>
+        /// Ensures the current working directory is used when index directory is not supplied. 
+        /// </summary>
+        [Test]
+        public void TestNoArguments()
+        {
+            AssertConsoleOutput("", "Lucene.Net Command Line Utility, Version");
+        }
+
+        [Test]
+        public void TestTooManyArguments()
+        {
+            Assert.Throws<CommandParsingException>(() => AssertConsoleOutput("one", ""));
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/9e389540/src/tools/Lucene.Net.Tests.Cli/Commands/Lock/LockStressTestCommandTest.cs
----------------------------------------------------------------------
diff --git a/src/tools/Lucene.Net.Tests.Cli/Commands/Lock/LockStressTestCommandTest.cs b/src/tools/Lucene.Net.Tests.Cli/Commands/Lock/LockStressTestCommandTest.cs
new file mode 100644
index 0000000..462ebb2
--- /dev/null
+++ b/src/tools/Lucene.Net.Tests.Cli/Commands/Lock/LockStressTestCommandTest.cs
@@ -0,0 +1,64 @@
+using Lucene.Net.Cli.CommandLine;
+using NUnit.Framework;
+using System.Collections.Generic;
+
+namespace Lucene.Net.Cli.Commands
+{
+    /*
+     * Licensed to the Apache Software Foundation (ASF) under one or more
+     * contributor license agreements.  See the NOTICE file distributed with
+     * this work for additional information regarding copyright ownership.
+     * The ASF licenses this file to You under the Apache License, Version 2.0
+     * (the "License"); you may not use this file except in compliance with
+     * the License.  You may obtain a copy of the License at
+     *
+     *     http://www.apache.org/licenses/LICENSE-2.0
+     *
+     * Unless required by applicable law or agreed to in writing, software
+     * distributed under the License is distributed on an "AS IS" BASIS,
+     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     * See the License for the specific language governing permissions and
+     * limitations under the License.
+     */
+
+    public class LockStressTestCommandTest : CommandTestCase
+    {
+        protected override ConfigurationBase CreateConfiguration(MockConsoleApp app)
+        {
+            return new LockStressTestCommand.Configuration(new CommandLineOptions()) { Main = (args) => app.Main(args) };
+        }
+
+        protected override IList<Arg[]> GetOptionalArgs()
+        {
+            // NOTE: We must order this in the sequence of the expected output.
+            return new List<Arg[]>();
+        }
+        protected override IList<Arg[]> GetRequiredArgs()
+        {
+            // NOTE: We must order this in the sequence of the expected output.
+            return new List<Arg[]>()
+            {
+                new Arg[] { new Arg(inputPattern: "12345", output: new string[] { "12345" }) },
+                new Arg[] { new Arg(inputPattern: "192.168.0.1", output: new string[] { "192.168.0.1" }) },
+                new Arg[] { new Arg(inputPattern: "9876", output: new string[] { "9876" }) },
+                new Arg[] { new Arg(inputPattern: "NativeFSLockFactory", output: new string[] { "NativeFSLockFactory" }) },
+                new Arg[] { new Arg(inputPattern: @"F:\temp2", output: new string[] { @"F:\temp2" }) },
+                new Arg[] { new Arg(inputPattern: "100", output: new string[] { "100" }) },
+                new Arg[] { new Arg(inputPattern: "10", output: new string[] { "10" }) },
+            };
+        }
+
+        [Test]
+        public void TestNotEnoughArguments()
+        {
+            Assert.NotNull(FromResource("NotEnoughArguments"));
+            AssertConsoleOutput("one two three four five six", FromResource("NotEnoughArguments", 7));
+        }
+
+        [Test]
+        public void TestTooManyArguments()
+        {
+            Assert.Throws<CommandParsingException>(() => AssertConsoleOutput("one two three four five six seven eight", ""));
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/9e389540/src/tools/Lucene.Net.Tests.Cli/Commands/Lock/LockVerifyServerCommandTest.cs
----------------------------------------------------------------------
diff --git a/src/tools/Lucene.Net.Tests.Cli/Commands/Lock/LockVerifyServerCommandTest.cs b/src/tools/Lucene.Net.Tests.Cli/Commands/Lock/LockVerifyServerCommandTest.cs
new file mode 100644
index 0000000..a76a99c
--- /dev/null
+++ b/src/tools/Lucene.Net.Tests.Cli/Commands/Lock/LockVerifyServerCommandTest.cs
@@ -0,0 +1,59 @@
+using Lucene.Net.Cli.CommandLine;
+using NUnit.Framework;
+using System.Collections.Generic;
+
+namespace Lucene.Net.Cli.Commands
+{
+    /*
+     * Licensed to the Apache Software Foundation (ASF) under one or more
+     * contributor license agreements.  See the NOTICE file distributed with
+     * this work for additional information regarding copyright ownership.
+     * The ASF licenses this file to You under the Apache License, Version 2.0
+     * (the "License"); you may not use this file except in compliance with
+     * the License.  You may obtain a copy of the License at
+     *
+     *     http://www.apache.org/licenses/LICENSE-2.0
+     *
+     * Unless required by applicable law or agreed to in writing, software
+     * distributed under the License is distributed on an "AS IS" BASIS,
+     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     * See the License for the specific language governing permissions and
+     * limitations under the License.
+     */
+
+    public class LockVerifyServerCommandTest : CommandTestCase
+    {
+        protected override ConfigurationBase CreateConfiguration(MockConsoleApp app)
+        {
+            return new LockVerifyServerCommand.Configuration(new CommandLineOptions()) { Main = (args) => app.Main(args) };
+        }
+
+        protected override IList<Arg[]> GetOptionalArgs()
+        {
+            // NOTE: We must order this in the sequence of the expected output.
+            return new List<Arg[]>();
+        }
+        protected override IList<Arg[]> GetRequiredArgs()
+        {
+            // NOTE: We must order this in the sequence of the expected output.
+            return new List<Arg[]>()
+            {
+                new Arg[] { new Arg(inputPattern: "192.168.0.1", output: new string[] { "192.168.0.1" }) },
+                new Arg[] { new Arg(inputPattern: "10", output: new string[] { "10" }) },
+            };
+        }
+
+        [Test]
+        public void TestNotEnoughArguments()
+        {
+            Assert.NotNull(FromResource("NotEnoughArguments"));
+            AssertConsoleOutput("one", FromResource("NotEnoughArguments", 2));
+        }
+
+        [Test]
+        public void TestTooManyArguments()
+        {
+            Assert.Throws<CommandParsingException>(() => AssertConsoleOutput("one two three", ""));
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/9e389540/src/tools/Lucene.Net.Tests.Cli/Commands/RootCommandTest.cs
----------------------------------------------------------------------
diff --git a/src/tools/Lucene.Net.Tests.Cli/Commands/RootCommandTest.cs b/src/tools/Lucene.Net.Tests.Cli/Commands/RootCommandTest.cs
new file mode 100644
index 0000000..543cf24
--- /dev/null
+++ b/src/tools/Lucene.Net.Tests.Cli/Commands/RootCommandTest.cs
@@ -0,0 +1,48 @@
+using Lucene.Net.Cli.CommandLine;
+using NUnit.Framework;
+using System.Collections.Generic;
+
+namespace Lucene.Net.Cli.Commands
+{
+    /*
+     * Licensed to the Apache Software Foundation (ASF) under one or more
+     * contributor license agreements.  See the NOTICE file distributed with
+     * this work for additional information regarding copyright ownership.
+     * The ASF licenses this file to You under the Apache License, Version 2.0
+     * (the "License"); you may not use this file except in compliance with
+     * the License.  You may obtain a copy of the License at
+     *
+     *     http://www.apache.org/licenses/LICENSE-2.0
+     *
+     * Unless required by applicable law or agreed to in writing, software
+     * distributed under the License is distributed on an "AS IS" BASIS,
+     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     * See the License for the specific language governing permissions and
+     * limitations under the License.
+     */
+
+    public class RootCommandTest : CommandTestCase
+    {
+        protected override ConfigurationBase CreateConfiguration(MockConsoleApp app)
+        {
+            return new RootCommand.Configuration(new CommandLineOptions()) { Main = (args) => app.Main(args) };
+        }
+
+        protected override IList<Arg[]> GetOptionalArgs()
+        {
+            // NOTE: We must order this in the sequence of the expected output.
+            return new List<Arg[]>();
+        }
+        protected override IList<Arg[]> GetRequiredArgs()
+        {
+            // NOTE: We must order this in the sequence of the expected output.
+            return new List<Arg[]>();
+        }
+
+        [Test]
+        public void TestTooManyArguments()
+        {
+            Assert.Throws<CommandParsingException>(() => AssertConsoleOutput("one", ""));
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/9e389540/src/tools/Lucene.Net.Tests.Cli/EnumerableExtensions.cs
----------------------------------------------------------------------
diff --git a/src/tools/Lucene.Net.Tests.Cli/EnumerableExtensions.cs b/src/tools/Lucene.Net.Tests.Cli/EnumerableExtensions.cs
new file mode 100644
index 0000000..95ad494
--- /dev/null
+++ b/src/tools/Lucene.Net.Tests.Cli/EnumerableExtensions.cs
@@ -0,0 +1,60 @@
+using System.Collections.Generic;
+using System.Linq;
+
+namespace Lucene.Net.Cli
+{
+    /*
+     * Licensed to the Apache Software Foundation (ASF) under one or more
+     * contributor license agreements.  See the NOTICE file distributed with
+     * this work for additional information regarding copyright ownership.
+     * The ASF licenses this file to You under the Apache License, Version 2.0
+     * (the "License"); you may not use this file except in compliance with
+     * the License.  You may obtain a copy of the License at
+     *
+     *     http://www.apache.org/licenses/LICENSE-2.0
+     *
+     * Unless required by applicable law or agreed to in writing, software
+     * distributed under the License is distributed on an "AS IS" BASIS,
+     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     * See the License for the specific language governing permissions and
+     * limitations under the License.
+     */
+
+    public static class Extensions
+    {
+        public static IEnumerable<IEnumerable<T>> OptionalParameters<T>(this IEnumerable<IEnumerable<T>> input)
+        {
+            if (input.Count() == 0)
+                yield break;
+            else
+            {
+                var rest = OptionalParameters(input.Skip(1));
+                foreach (var p in input.First())
+                {
+                    yield return new[] { p };
+                    foreach (var r in rest)
+                        yield return r.Prepend(p);
+                }
+                foreach (var r in rest)
+                    yield return r;
+            }
+        }
+
+        public static IEnumerable<IEnumerable<T>> RequiredParameters<T>(this IEnumerable<IEnumerable<T>> input)
+        {
+            int count = input.Count();
+            if (count == 1)
+                foreach (var p in input.First())
+                    yield return new[] { p };
+            else if (count > 1)
+            {
+                var rest = RequiredParameters(input.Skip(1));
+                foreach (var p in input.First())
+                {
+                    foreach (var r in rest)
+                        yield return r.Prepend(p);
+                }
+            }
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/9e389540/src/tools/Lucene.Net.Tests.Cli/Lucene.Net.Tests.Cli.xproj
----------------------------------------------------------------------
diff --git a/src/tools/Lucene.Net.Tests.Cli/Lucene.Net.Tests.Cli.xproj b/src/tools/Lucene.Net.Tests.Cli/Lucene.Net.Tests.Cli.xproj
new file mode 100644
index 0000000..9554cd2
--- /dev/null
+++ b/src/tools/Lucene.Net.Tests.Cli/Lucene.Net.Tests.Cli.xproj
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <PropertyGroup>
+    <VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">14.0</VisualStudioVersion>
+    <VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
+  </PropertyGroup>
+  <Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.Props" Condition="'$(VSToolsPath)' != ''" />
+  <PropertyGroup Label="Globals">
+    <ProjectGuid>495b65f0-0b01-40fe-9dc8-5a82c49e07ef</ProjectGuid>
+    <RootNamespace>Lucene.Net.Cli</RootNamespace>
+    <BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">.\obj</BaseIntermediateOutputPath>
+    <OutputPath Condition="'$(OutputPath)'=='' ">.\bin\</OutputPath>
+    <TargetFrameworkVersion>v4.5.1</TargetFrameworkVersion>
+  </PropertyGroup>
+  <PropertyGroup>
+    <SchemaVersion>2.0</SchemaVersion>
+  </PropertyGroup>
+  <ItemGroup>
+    <Service Include="{82a7f48d-3b50-4b1e-b82e-3ada8210c358}" />
+  </ItemGroup>
+  <Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.targets" Condition="'$(VSToolsPath)' != ''" />
+</Project>
\ No newline at end of file


[18/22] lucenenet git commit: Lucene.Net.Tests.Cli: Added ComonAssemblyInfo.cs reference, moved build options to common section of project.json and fixed AssemblyInfo attributes to remove conflicts.

Posted by ni...@apache.org.
Lucene.Net.Tests.Cli: Added ComonAssemblyInfo.cs reference, moved build options to common section of project.json and fixed AssemblyInfo attributes to remove conflicts.


Project: http://git-wip-us.apache.org/repos/asf/lucenenet/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucenenet/commit/d0e5d981
Tree: http://git-wip-us.apache.org/repos/asf/lucenenet/tree/d0e5d981
Diff: http://git-wip-us.apache.org/repos/asf/lucenenet/diff/d0e5d981

Branch: refs/heads/master
Commit: d0e5d981b8fa4ab80c21c4aa57622484475ac4d0
Parents: 18a934c
Author: Shad Storhaug <sh...@shadstorhaug.com>
Authored: Tue Jul 11 12:51:00 2017 +0700
Committer: Shad Storhaug <sh...@shadstorhaug.com>
Committed: Tue Jul 11 12:51:00 2017 +0700

----------------------------------------------------------------------
 .../Properties/AssemblyInfo.cs                  |  6 ++---
 src/tools/Lucene.Net.Tests.Cli/project.json     | 27 ++++++++++++--------
 2 files changed, 19 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucenenet/blob/d0e5d981/src/tools/Lucene.Net.Tests.Cli/Properties/AssemblyInfo.cs
----------------------------------------------------------------------
diff --git a/src/tools/Lucene.Net.Tests.Cli/Properties/AssemblyInfo.cs b/src/tools/Lucene.Net.Tests.Cli/Properties/AssemblyInfo.cs
index a5b2792..17c698d 100644
--- a/src/tools/Lucene.Net.Tests.Cli/Properties/AssemblyInfo.cs
+++ b/src/tools/Lucene.Net.Tests.Cli/Properties/AssemblyInfo.cs
@@ -22,10 +22,10 @@ using System.Runtime.InteropServices;
 // General Information about an assembly is controlled through the following
 // set of attributes. Change these attribute values to modify the information
 // associated with an assembly.
+[assembly: AssemblyTitle("Lucene.Net.Tests.Cli")]
+[assembly: AssemblyDescription("")]
 [assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("")]
-[assembly: AssemblyProduct("Lucene.Net.Tests.Cli")]
-[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
 
 // Setting ComVisible to false makes the types in this assembly not visible
 // to COM components.  If you need to access a type in this assembly from

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/d0e5d981/src/tools/Lucene.Net.Tests.Cli/project.json
----------------------------------------------------------------------
diff --git a/src/tools/Lucene.Net.Tests.Cli/project.json b/src/tools/Lucene.Net.Tests.Cli/project.json
index 9ff17e3..8e779c5 100644
--- a/src/tools/Lucene.Net.Tests.Cli/project.json
+++ b/src/tools/Lucene.Net.Tests.Cli/project.json
@@ -1,6 +1,21 @@
 {
   "version": "4.8.0",
   "title": "Lucene.Net.Tests.Cli",
+  "buildOptions": {
+    "compile": {
+      "includeFiles": [
+        "../../CommonAssemblyInfo.cs"
+      ],
+      "excludeFiles": [
+        "SourceCode/TestInputForParser.cs"
+      ]
+    },
+    "embed": {
+      "includeFiles": [
+        "SourceCode/TestInputForParser.cs"
+      ]
+    }
+  },
   "dependencies": {
     "dotnet-test-nunit-teamcity": "3.4.0-beta-3",
     "lucene-cli": "4.8.0",
@@ -14,17 +29,7 @@
       "imports": "dnxcore50",
       "buildOptions": {
         "debugType": "portable",
-        "define": [ "NETSTANDARD" ],
-        "compile": {
-          "excludeFiles": [
-            "SourceCode/TestInputForParser.cs"
-          ]
-        },
-        "embed": {
-          "includeFiles": [
-            "SourceCode/TestInputForParser.cs"
-          ]
-        }
+        "define": [ "NETSTANDARD" ]
       }
     }
   },