public virtual void Print(TextWriter writer, CommandMethodDescriptor descriptor, CommandMemberDescriptor memberDescriptor)
 {
     if (writer is CommandTextWriter commandWriter)
     {
         this.Print(commandWriter, descriptor, memberDescriptor);
     }
     else
     {
         using var tw = new CommandTextWriter()
               {
                   IsAnsiSupported = this.IsAnsiSupported
               };
         this.Print(tw, descriptor, memberDescriptor);
         writer.Write(tw.ToString());
     }
 }
        private void PrintList()
        {
            using var writer = new CommandTextWriter()
                  {
                      IsAnsiSupported = this.IsAnsiSupported
                  };
            var parser = new CommandLineParser(this.ExecutionName, this)
            {
                Out = writer
            };
            var query = from item in this.CommandContext.Node.Childs
                        where item.IsEnabled == true
                        orderby item.Name
                        select item;

            parser.PrintUsage(string.Empty, this.Usage);
            writer.WriteLine(Resources.Text_AvaliableCommands);
            writer.Indent++;

            foreach (var item in query)
            {
                var descriptor = item.Descriptor;
                var summary    = descriptor != null ? descriptor.Summary : string.Empty;
                var name       = GetCommandNames(item);
                writer.WriteLine(name);
                if (summary != string.Empty && this.Usage != CommandUsage.Simple)
                {
                    writer.Indent++;
                    writer.WriteMultiline(summary);
                    writer.Indent--;
                }
                if (query.Last() != item && this.Usage != CommandUsage.Simple)
                {
                    writer.WriteLine();
                }
            }
            writer.Indent--;
            this.Out.Write(writer.ToString());
        }