package com.campmongoose.serversaturday.sponge.command;

import com.campmongoose.serversaturday.common.Reference;
import com.campmongoose.serversaturday.sponge.SpongeServerSaturday;
import javax.annotation.Nonnull;
import org.spongepowered.api.Sponge;
import org.spongepowered.api.command.CommandException;
import org.spongepowered.api.command.CommandMapping;
import org.spongepowered.api.command.CommandResult;
import org.spongepowered.api.command.CommandSource;
import org.spongepowered.api.command.args.CommandContext;
import org.spongepowered.api.text.Text;
import org.spongepowered.api.text.format.TextColors;

public class SSCommand extends AbstractSpongeCommand {

    @Nonnull
    @Override
    public CommandResult execute(@Nonnull CommandSource source, @Nonnull CommandContext args) throws CommandException {
        Text.join(Text.builder("===== ").color(TextColors.GREEN).build(), Text.of(Reference.NAME + " v" + Reference.VERSION), Text.builder(" by ").color(TextColors.GREEN).build(), Text.of("Musician101"), Text.builder(" =====").color(TextColors.GREEN).build());
        Sponge.getCommandManager().getOwnedBy(SpongeServerSaturday.instance()).stream().map(CommandMapping::getCallable)
                .filter(command -> command.testPermission(source))
                .forEach(command -> command.getHelp(source));

        return CommandResult.success();
    }
}

@@ -289,25 +289,24 @@
 .Command
-Exception
+Callable
 ;%0Aimport
@@ -343,23 +343,25 @@
 .Command
-Mapping
+Exception
 ;%0Aimport
@@ -821,16 +821,35 @@
         
+source.sendMessage(
 Text.joi
@@ -1091,16 +1091,17 @@
 build())
+)
 ;%0A      
@@ -1177,22 +1177,75 @@
 ()).
-stream().map(C
+forEach(commandMapping -%3E %7B%0A            CommandCallable command = c
 omma
@@ -1257,10 +1257,9 @@
 ping
-::
+.
 getC
@@ -1265,21 +1265,20 @@
 Callable
-)%0A   
+();%0A
         
@@ -1285,119 +1285,328 @@
     
- .filter(command -%3E command.testPermission(source))%0A                .forEach(command -%3E command.getHelp(source)
+command.getShortDescription(source).ifPresent(description -%3E%0A                    source.sendMessage(Text.join(Text.builder(%22/%22 + commandMapping.getPrimaryAlias() + %22 %22).color(TextColors.GRAY).build(), command.getUsage(source), Text.of(%22 %22), Text.builder().append(description).color(TextColors.AQUA).build())));%0A        %7D
 );%0A%0A

Fix built in help command.