Skip to content

Commit

Permalink
Finalizing docs for now
Browse files Browse the repository at this point in the history
  • Loading branch information
Mqzn committed Sep 23, 2024
1 parent 2f0dd21 commit ccc5011
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 12 deletions.
7 changes: 1 addition & 6 deletions docs/Imperat/Command Help.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,6 @@ sidebar_position: 8
# Command Help

A command help is an object that is responsible for showing all the help usages of a command you make, it's easy to customize how will your help-menu will be displayed.
The `CommandHelp` requires 3 main objects so that a new instance of it can be made :
- The command being executed
- The context of the command being executed
- The detected usage that has been issued by the command-sender. <br/>
and it's created through the `Context#createCommandHelp` during the lifecycle of command-execution period, so it's not required from you to create one manually unless you know exactly what are you doing. <br/>

The `CommandHelp` object is created automatically for you, to specify a command help object in classic, just call in the execution
`context.getContextResolvedArgument(CommandHelp.class)` or in the annotations by adding a parameter with type `CommandHelp` and it will be context resolved automatically.
Expand Down Expand Up @@ -44,7 +39,7 @@ public final class GroupCommand {
) {
source.reply("Group entered= " + group.name());
//showing help to the user
help.display(source);
help.display();
}
}
```
Expand Down
13 changes: 9 additions & 4 deletions docs/Imperat/Introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,22 @@ Imperat is a powerful command dispatching framework, it allows you to create
commands and converts them into the form of multiple data-condensed objects like `Command`, `CommandUsage` and `CommandParameter`
These objects are registered/injected into the class `Imperat` which handles all information about each command and then dispatches/executes the command requested.

# Creating Command Dispatcher
# Initiazling your Imperat

**Frequently asked question:** ***What's a command dispatcher/Imperat ??*** <br/>
**Answer:** It's the Ultimate class handling all data needed when processing and registering
commands objects (`Command`) you have to create **new instance** of the command dispatcher
on the **start** of your application/program/spigot plugin.
commands objects (`Command`).
You have to create **new instance** of the imperat.
on the **start** of your platform by calling `YourPlatformImperat#create` (the method is static) to create
and initialize a new instance of `Imperat` type.

:::tip[TIP]
Creation of an instance of your `PlatformImperat` depends mainly on which platform
you are using. For more details, Check out [Supported-Platforms](Supported-Platforms.md)

# Modifying The Command Dispatcher
:::

# Customizing Imperat

If you wanted to register a [Context Resolver](Context%20Resolver.md) or a [Value Resolver](Value%20Resolver.md) , or even
set a [Suggestion Resolver](Suggestion%20Resolver.md) for tab-completion in commands, You would have to
Expand Down
8 changes: 6 additions & 2 deletions docs/Imperat/Supported-Platforms.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,10 @@ SAME AS BUKKIT but the prefix is `Bungee`


## Other platforms
- **CLI** for command-line applications
More coming soon...
### CLI
**CLI** for command-line applications, The `CommandLineImperat` is the impl for Imperat on CLI platform.
the command source in CLI is called `ConsoleSource`.

### Others
coming soon...

0 comments on commit ccc5011

Please sign in to comment.