Пример #1
0
 public void ShowUsage()
 {
     foreach (var par in parameters)
     {
         Cout.Write(" " + par.Name);
     }
 }
Пример #2
0
        public void ShowUsage()
        {
            Cout.Write("Usage: " + path);

            foreach (var opt in options)
            {
                Cout.Write(" [-" + opt.Key);
                opt.Value.ShowUsage();
                Cout.Write("]");
            }

            Cout.WriteLine();
        }
Пример #3
0
            public void ShowHelp()
            {
                if (parameters.Count > 0)
                {
                    foreach (var par in parameters)
                    {
                        Cout.Write(" " + par.Name + "\t");
                    }
                }
                else
                {
                    Cout.Write("\t\t");
                }

                Cout.Write(comment);
            }
Пример #4
0
        public void ShowHelp()
        {
            ShowUsage();

            Cout.WriteLine();

            foreach (var opt in options)
            {
                Cout.Write("\t-" + opt.Key);
                opt.Value.ShowHelp();
                Cout.WriteLine();
            }

            if (!string.IsNullOrWhiteSpace(comment))
            {
                Cout.WriteLine();
                Cout.WriteLine(comment);
            }
        }
Пример #5
0
            public void ShowHelp()
            {
                string possibleValues = "";

                if (parameters.Count > 0)
                {
                    int length = 0;

                    foreach (var par in parameters)
                    {
                        Cout.Write(" " + par.Name);
                        length += par.Name.Length + 1;

                        if (par.PossibleValues != null)
                        {
                            possibleValues += SplitToLines("  " + par.Name + ": " + par.PossibleValues, 2 + CommentRowOffset, par.Name.Length + 2) + Environment.NewLine;
                        }
                    }

                    if (length < CommentRowOffset)
                    {
                        Cout.Write(new string(' ', CommentRowOffset - length));
                    }
                    else
                    {
                        Cout.Write(" ");
                    }
                }
                else
                {
                    Cout.Write(new string(' ', CommentRowOffset));
                }

                Cout.Write(SplitToLines(comment, 2 + CommentRowOffset).TrimEnd());

                if (possibleValues.Length > 0)
                {
                    Cout.Write(Environment.NewLine + "\t" + new string(' ', CommentRowOffset) + possibleValues.TrimEnd());
                }
            }