示例#1
0
        /// <summary>
        /// Called at the beginning of a test - it dumps the usage of the Arguments class(es).
        /// </summary>
        private static void Init(IndentingTextWriter wrt, object defaults)
        {
            var env = new TlcEnvironment(seed: 42);

            wrt.WriteLine("Usage:");
            wrt.WriteLine(CmdParser.ArgumentsUsage(env, defaults.GetType(), defaults, false, 200));
        }
        private void ShowUsage(IndentingTextWriter writer, string kind, string summary, string loadName,
                               IReadOnlyList <string> loadNames, object args, int?columns)
        {
            _env.Assert(loadName == loadNames[0]);

            writer.WriteLine("Help for {0}: '{1}'", kind, loadName);
            using (writer.Nest())
                ShowAliases(writer, loadNames);

            writer.WriteLine();
            ShowFormattedSummary(writer, summary, columns);

            if (args == null)
            {
                writer.WriteLine("Component '{0}' is not configurable", loadName);
                writer.WriteLine();
            }
            else
            {
                writer.WriteLine(CmdParser.ArgumentsUsage(_env, args.GetType(), args, false, columns));
            }
        }