示例#1
0
        public void Run(int?columns)
        {
#pragma warning disable CS0618 // The help command should be entirely within the command line anyway.
            AssemblyLoadingUtils.LoadAndRegister(_env, _extraAssemblies);
#pragma warning restore CCS0618

            using (var ch = _env.Start("Help"))
                using (var sw = new StringWriter(CultureInfo.InvariantCulture))
                    using (var writer = new IndentedTextWriter(sw, "  "))
                    {
                        if (_listKinds)
                        {
                            if (_component != null)
                            {
                                writer.WriteLine("Listing component kinds so ignoring specified component");
                            }
                            else if (_kind != null)
                            {
                                writer.WriteLine("Listing component kinds so ignoring specified kind");
                            }
                            ListKinds(writer);
                        }
                        else if (_component != null)
                        {
                            ShowHelp(writer, columns);
                        }
                        else if (_allComponents)
                        {
                            ShowAllHelp(writer, columns);
                        }
                        else
                        {
                            ShowComponents(writer);
                        }

                        ch.Info(sw.ToString());
                    }
        }
示例#2
0
        public void Run(int?columns)
        {
            AssemblyLoadingUtils.LoadAndRegister(_env, _extraAssemblies);

            using (var ch = _env.Start("Help"))
                using (var sw = new StringWriter(CultureInfo.InvariantCulture))
                    using (var writer = IndentingTextWriter.Wrap(sw))
                    {
                        if (_listKinds)
                        {
                            if (_component != null)
                            {
                                writer.WriteLine("Listing component kinds so ignoring specified component");
                            }
                            else if (_kind != null)
                            {
                                writer.WriteLine("Listing component kinds so ignoring specified kind");
                            }
                            ListKinds(writer);
                        }
                        else if (_component != null)
                        {
                            ShowHelp(writer, columns);
                        }
                        else if (_allComponents)
                        {
                            ShowAllHelp(writer, columns);
                        }
                        else
                        {
                            ShowComponents(writer);
                        }

                        ch.Info(sw.ToString());
                        ch.Done();
                    }
        }