Alias stuff

That_One_Nerd 2023-03-29 10:05:44 -04:00
parent b302bbe2f6
commit 270a0681a0

@ -11,7 +11,7 @@ Commands must be in a [module](Modules) to be recognized. Any commands not insid
| `short` (`System.Int16`) | | `short` (`System.Int16`) |
| `ushort` (`System.UInt16`) | | `ushort` (`System.UInt16`) |
| `int` (`System.Int32`) | | `int` (`System.Int32`) |
| `uint` (`System.UInt32` | | `uint` (`System.UInt32`) |
| `long` (`System.Int64`) | | `long` (`System.Int64`) |
| `ulong` (`System.UInt64`) | | `ulong` (`System.UInt64`) |
| `System.Int128` | | `System.Int128` |
@ -36,7 +36,7 @@ Here is an example:
using SrcMod.Shell.Modules.ObjectModels; using SrcMod.Shell.Modules.ObjectModels;
[Module("example")] [Module("example")]
public static class ExampleModule public static class ExampleModule1
{ {
[Command("command")] [Command("command")]
public static void ExampleCommand() public static void ExampleCommand()
@ -48,6 +48,26 @@ public static class ExampleModule
As said earlier, commands can have parameters as long as they fit the earlier given types or can be implicitly or explicitly casted from them. During the parsing process, parameters are split by spaces (except if in quotations). As said earlier, commands can have parameters as long as they fit the earlier given types or can be implicitly or explicitly casted from them. During the parsing process, parameters are split by spaces (except if in quotations).
One method can also have multiple command names. This is how to add aliases to a command. Simply add another command attribute and give it another name.
Here is an example:
```csharp
// Used for the `CommandAttribute` and `ModuleAttribute`.
using SrcMod.Shell.Modules.ObjectModels;
[Module("example")]
public static class ExampleModule2
{
[Command("command")]
[Command("test")]
public static void ExampleCommand()
{
// Invoked by executing "example command" *or*
// "example test"
}
}
```
--- ---
## Default Commands ## Default Commands
@ -80,8 +100,8 @@ Parameters:
--- ---
#### `cut` #### `cut`, `move`
Moves a file or directory to a new location on the computer. Identical to [`move`](#move). Moves a file or directory to a new location on the computer.
Parameters: Parameters:
- source: `string` - source: `string`
@ -119,8 +139,8 @@ Parameters:
--- ---
#### `exit` #### `exit`, `quit`
Exit the shell. Identical to [`quit`](#quit) Exit the shell.
Parameters: Parameters:
- code: `int` - code: `int`
@ -144,17 +164,6 @@ Prints the history of all reversable commands executed by the shell.
--- ---
#### `move`
Moves a file or directory to a new location on the computer. Identical to [`cut`](#cut).
Parameters:
- source: `string`
- The original location of the file or directory.
- destination: `string`
- The new location for the file or directory.
---
#### `permdel` #### `permdel`
Permanently deletes a file or directory. Permanently deletes a file or directory.
@ -164,8 +173,8 @@ Parameters:
--- ---
#### `print` #### `print`, `type`
Prints the contents of a given file to the console. Identical to [`type`](#type). Prints the contents of a given file to the console.
Parameters: Parameters:
- file: `string` - file: `string`
@ -187,25 +196,6 @@ How about you find out for yourself.
--- ---
#### `quit`
Quit the shell.
Parameters:
- code: `int`
- The exit code to close with.
- Default Value: `0`
---
#### `type`
Prints the contents of a given file to the console. Identical to [`print`](#print).
Parameters:
- file: `string`
- The path of the file to print.
---
#### `undo` #### `undo`
Undoes a command or commands in the history *that can be undone*. Undoes a command or commands in the history *that can be undone*.