Пример #1
0
        /// <summary>
        /// Parses ConsensusGeneration command line parameters.
        /// </summary>
        /// <param name="args">The arguments.</param>
        private static void ConsensusGeneration(string[] args)
        {
            ConsensusArguments   arguments = new ConsensusArguments();
            CommandLineArguments parser    = new CommandLineArguments();

            // Add the parameters
            parser.Parameter(ArgumentType.DefaultArgument, "FilePath", ArgumentValueType.MultipleUniqueStrings, "", "File path");
            parser.Parameter(ArgumentType.Optional, "Help", ArgumentValueType.Bool, "h", "Print the help information.");
            parser.Parameter(ArgumentType.Optional, "OutputFile", ArgumentValueType.String, "o", "Output file.");
            parser.Parameter(ArgumentType.Optional, "Verbose", ArgumentValueType.Bool, "v", "Display verbose logging during processing.");

            if (args.Length > 1)
            {
                try
                {
                    parser.Parse(args, arguments);
                }
                catch (ArgumentException ex)
                {
                    DisplayErrorMessage(ex.Message);
                    DisplayErrorMessage(Resources.ConsensusUtilHelp);
                    Environment.Exit(-1);
                }

                if (arguments.Help)
                {
                    DisplayErrorMessage(Resources.ConsensusUtilHelp);
                }
                else if (arguments.FilePath.Length == 2)
                {
                    arguments.GenerateConsensus();
                }
                else
                {
                    DisplayErrorMessage(Resources.ConsensusUtilHelp);
                }
            }
            else
            {
                DisplayErrorMessage(Resources.ConsensusUtilHelp);
            }
        }
Пример #2
0
        /// <summary>
        /// Parses ConsensusGeneration command line parameters.
        /// </summary>
        /// <param name="args">The arguments.</param>
        private static void ConsensusGeneration(string[] args)
        {
            ConsensusArguments arguments = new ConsensusArguments();

            if (args.Length > 1 && Parser.ParseArguments(args, arguments))
            {
                if (!string.IsNullOrEmpty(arguments.FilePath))
                {
                    arguments.GenerateConsensus();
                }
                else
                {
                    DisplayErrorMessage(Resources.ConsensusUtilHelp);
                }
            }
            else
            {
                DisplayErrorMessage(Resources.ConsensusUtilHelp);
            }
        }
Пример #3
0
        /// <summary>
        /// Parses ConsensusGeneration command line parameters.
        /// </summary>
        /// <param name="args">The arguments.</param>
        private static void ConsensusGeneration(string[] args)
        {
            ConsensusArguments arguments = new ConsensusArguments();
            CommandLineArguments parser = new CommandLineArguments();

            // Add the parameters
            parser.Parameter(ArgumentType.DefaultArgument, "FilePath", ArgumentValueType.MultipleUniqueStrings, "", "File path");
            parser.Parameter(ArgumentType.Optional, "Help", ArgumentValueType.Bool, "h", "Print the help information.");
            parser.Parameter(ArgumentType.Optional, "OutputFile", ArgumentValueType.String, "o", "Output file.");
            parser.Parameter(ArgumentType.Optional, "Verbose", ArgumentValueType.Bool, "v", "Display verbose logging during processing.");

            if (args.Length > 1)
            {
                try
                {
                    parser.Parse(args, arguments);
                }
                catch (ArgumentException ex)
                {
                    Output.WriteLine(OutputLevel.Error, ex.Message);
                    Output.WriteLine(OutputLevel.Required, Resources.ConsensusUtilHelp);
                    Environment.Exit(-1);
                }

                if (arguments.Help || arguments.FilePath.Length != 2)
                {
                    Output.WriteLine(OutputLevel.Required, Resources.ConsensusUtilHelp);
                }
                else
                {
                    arguments.GenerateConsensus();
                }
            }
            else
            {
                Output.WriteLine(OutputLevel.Required, Resources.ConsensusUtilHelp);
            }
        }