Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
        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);
        }
Exemplo n.º 3
0
        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);
        }