Exemple #1
0
        /// <summary>
        /// Parses RepeatResolver command line parameters.
        /// </summary>
        /// <param name="args">The arguments.</param>
        private static void RepeatResolver(string[] args)
        {
            RepeatResolutionArguments arguments = new RepeatResolutionArguments();
            CommandLineArguments      parser    = new CommandLineArguments();

            // Add 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.RepeatResolutionUtilHelp);
                    Environment.Exit(-1);
                }

                if (arguments.Help)
                {
                    DisplayErrorMessage(Resources.RepeatResolutionUtilHelp);
                }
                else if (arguments.FilePath.Length == 2)
                {
                    arguments.ResolveAmbiguity();
                }
                else
                {
                    DisplayErrorMessage(Resources.RepeatResolutionUtilHelp);
                }
            }
            else
            {
                DisplayErrorMessage(Resources.RepeatResolutionUtilHelp);
            }
        }
Exemple #2
0
        /// <summary>
        /// Parses RepeatResolver command line parameters.
        /// </summary>
        /// <param name="args">The arguments.</param>
        private static void RepeatResolver(string[] args)
        {
            RepeatResolutionArguments arguments = new RepeatResolutionArguments();
            CommandLineArguments parser = new CommandLineArguments();

            // Add 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.RepeatResolutionUtilHelp);
                    Environment.Exit(-1);
                }

                if (arguments.Help)
                {
                    DisplayErrorMessage(Resources.RepeatResolutionUtilHelp);
                }
                else if (arguments.FilePath.Length == 2)
                {
                    arguments.ResolveAmbiguity();
                }
                else
                {
                    DisplayErrorMessage(Resources.RepeatResolutionUtilHelp);
                }
            }
            else
            {
                DisplayErrorMessage(Resources.RepeatResolutionUtilHelp);
            }
        }
Exemple #3
0
        /// <summary>
        /// Parses RepeatResolver command line parameters.
        /// </summary>
        /// <param name="args">The arguments.</param>
        private static void RepeatResolver(string[] args)
        {
            RepeatResolutionArguments arguments = new RepeatResolutionArguments();

            if (args.Length > 1 && Parser.ParseArguments(args, arguments))
            {
                if (!string.IsNullOrEmpty(arguments.FilePath))
                {
                    arguments.ResolveAmbiguity();
                }
                else
                {
                    DisplayErrorMessage(Resources.RepeatResolutionUtilHelp);
                }
            }
            else
            {
                DisplayErrorMessage(Resources.RepeatResolutionUtilHelp);
            }
        }