Alias stuff
parent
b302bbe2f6
commit
270a0681a0
66
Commands.md
66
Commands.md
@ -11,7 +11,7 @@ Commands must be in a [module](Modules) to be recognized. Any commands not insid
|
||||
| `short` (`System.Int16`) |
|
||||
| `ushort` (`System.UInt16`) |
|
||||
| `int` (`System.Int32`) |
|
||||
| `uint` (`System.UInt32` |
|
||||
| `uint` (`System.UInt32`) |
|
||||
| `long` (`System.Int64`) |
|
||||
| `ulong` (`System.UInt64`) |
|
||||
| `System.Int128` |
|
||||
@ -36,7 +36,7 @@ Here is an example:
|
||||
using SrcMod.Shell.Modules.ObjectModels;
|
||||
|
||||
[Module("example")]
|
||||
public static class ExampleModule
|
||||
public static class ExampleModule1
|
||||
{
|
||||
[Command("command")]
|
||||
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).
|
||||
|
||||
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
|
||||
@ -80,8 +100,8 @@ Parameters:
|
||||
|
||||
---
|
||||
|
||||
#### `cut`
|
||||
Moves a file or directory to a new location on the computer. Identical to [`move`](#move).
|
||||
#### `cut`, `move`
|
||||
Moves a file or directory to a new location on the computer.
|
||||
|
||||
Parameters:
|
||||
- source: `string`
|
||||
@ -119,8 +139,8 @@ Parameters:
|
||||
|
||||
---
|
||||
|
||||
#### `exit`
|
||||
Exit the shell. Identical to [`quit`](#quit)
|
||||
#### `exit`, `quit`
|
||||
Exit the shell.
|
||||
|
||||
Parameters:
|
||||
- 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`
|
||||
Permanently deletes a file or directory.
|
||||
|
||||
@ -164,8 +173,8 @@ Parameters:
|
||||
|
||||
---
|
||||
|
||||
#### `print`
|
||||
Prints the contents of a given file to the console. Identical to [`type`](#type).
|
||||
#### `print`, `type`
|
||||
Prints the contents of a given file to the console.
|
||||
|
||||
Parameters:
|
||||
- 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`
|
||||
Undoes a command or commands in the history *that can be undone*.
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user