Azavea.NijPredictivePolicing.ACSAlchemist.Program.DisplayOptions C# (CSharp) Method

DisplayOptions() protected static method

Iterates over our Arguments collection and displays descriptions, flags, etc.
protected static DisplayOptions ( ) : void
return void
        protected static void DisplayOptions()
        {
            int maxCols = 80;   //try and wrap the output to look nice

            foreach (var arg in ImportJob.Arguments)
            {
                if (!arg.Display)
                    continue;

                string line = string.Format("  -{0, -15}: {1}", arg.Flag, arg.Description);
                if (line.Length > maxCols)
                {
                    while (line.Length > 0)
                    {
                        int numChars = Math.Min(maxCols, line.Length);

                        _log.InfoFormat(line.Substring(0, numChars));
                        if ((line.Length - maxCols) > 0)
                        {
                            line = "".PadLeft(arg.Flag.Length + 5, ' ') + line.Substring(numChars, line.Length - maxCols);
                        }
                        else
                            line = string.Empty;
                    }
                }
                else
                {
                    _log.InfoFormat(line);
                }
            }
            _log.Info("");
            _log.Info("**Pro Tip!  You can place all your arguments in a text file, and call AcsAlchemist.exe with just that filename");
            _log.Info("");
        }