From b6ed49adcdac322a43ba9271e48dbbfa4a626673 Mon Sep 17 00:00:00 2001 From: That_One_Nerd Date: Tue, 25 Apr 2023 18:05:53 -0400 Subject: [PATCH] updated the config command descriptions --- Commands.md | 117 ++++++++++++++++++++++++---------------------------- 1 file changed, 55 insertions(+), 62 deletions(-) diff --git a/Commands.md b/Commands.md index 5340a8c..a9cc85c 100644 --- a/Commands.md +++ b/Commands.md @@ -4,32 +4,36 @@ Commands are methods inside a [module](Modules) that the shell will execute when ## How to Use Commands must be in a [module](Modules) to be recognized. Any commands not inside their respective modules will be ignored. Commands are declared by applying the `CommandAttribute` attribute in the namespace `SrcMod.Shell.Modules.ObjectModels` to a method. The method can be static and must always have a body. The return type must be `void` and all parameters must have the following types: -| Type | -|-| -| `sbyte` (`System.SByte`) | -| `byte` (`System.Byte`) | -| `short` (`System.Int16`) | -| `ushort` (`System.UInt16`) | -| `int` (`System.Int32`) | -| `uint` (`System.UInt32`) | -| `long` (`System.Int64`) | -| `ulong` (`System.UInt64`) | -| `System.Int128` | -| `System.UInt128` | -| `nint` (`System.IntPtr`) | -| `nuint` (`System.UIntPtr`) | -| `System.Half` | -| `float` (`System.Single`) | -| `double` (`System.Double`) | -| `decimal` (`System.Decimal`) | -| `char` (`System.Char`) | -| `System.DateOnly` | -| `System.DateTime` | -| `System.DateTimeOffset` | -| `System.Enum` | -| `System.Guid` | -| `System.TimeOnly` | -| `System.TimeSpan` | +
+Allowed Types + +- `sbyte` (`System.SByte`) +- `byte` (`System.Byte`) +- `short` (`System.Int16`) +- `ushort` (`System.UInt16`) +- `int` (`System.Int32`) +- `uint` (`System.UInt32`) +- `long` (`System.Int64`) +- `ulong` (`System.UInt64`) +- `System.Int128` +- `System.UInt128` +- `nint` (`System.IntPtr`) +- `nuint` (`System.UIntPtr`) +- `System.Half` +- `float` (`System.Single`) +- `double` (`System.Double`) +- `decimal` (`System.Decimal`) +- `char` (`System.Char`) +- `System.DateOnly` +- `System.DateTime` +- `System.DateTimeOffset` +- `System.Enum` +- `System.Guid` +- `System.TimeOnly` +- `System.TimeSpan` +
+ +--- Here is an example: ```csharp @@ -374,72 +378,61 @@ Parameters: ### `config` #### `config add`, `config append` -Appends an item to a configuration variable. The variable in question must be a list. +Appends a single item to a config variable. The variable in question must be a list. Parameters: - name: `string` - - The name of the configuration variable. - - Possible Values: - - "GameDirectories" + - The specific variable to append to. Should be the name of a config variable (not case sensitive). - value: `string` - - The value to append to the configuration variable. + - The value to append to the list. Must be parsable into an object that has the same type as the list elements (or can cast to it). --- #### `config delete`, `config remove` -Removes a single item from a configuration variable. The variable in question must be a list. +Removes a single item to a config variable. The variable in question must be a list. Parameters: - name: `string` - - The name of the configuration variable. - - Possible Values: - - "GameDirectories" + - The specific variable to remove from. Should be the name of a config variable (not case sensitive). - value: `string` - - The value to remove from the configuration variable. + - The value to remove from the list. Must be parsable into an object that has the same type as the list elements (or can cast to it). --- #### `config display`, `config list` -Displays the configuration information on the console. Depending on the value of the parameter `mode`, the shell may display a single configuration option or multiple configuration options. +Displays config information about the shell. Parameters: -- mode: `ConfigDisplayMode` - - The type of information to display. - - Default Value: `All` - - Possible Values: - - `Raw` - - Displays all configuration info in raw format. - - `All` - - Displays all configuration info in a styled format. - - `GameDirectories` - - Displays the list of accepted Steam game directories to search in. - - `RunUnsafeCommands` - - Displays whether or not the shell executes unsafe commands without prompting the user. +- display: `string` + - The specific variable to display. Should be the name of a config variable (not case sensitive). + - Special cases: + - "all" + - The command displays all config variables at once. + - "raw" + - The command displays the raw, JSON-formatted config. + - Default Value: "all" --- #### `config reset` -Resets a single or multiple configuration variables to their default values. +Resets a config variable or variables to their default value or values. Parameters: -- name: `string` - - The name of the configuration variable. - - Possible Values: - - "All" - - "GameDirectories" - - "RunUnsafeCommands" +- display: `string` + - The specific variable to reset. Should be the name of a config variable (not case sensitive). + - Special cases: + - "all" + - The command resets all config variables to their default values. + - Default Value: "all" #### `config set` -Changes the value of a single configuration variable. The variable in question must be a single value. +Sets a config variable to a new value. Cannot change a list config variable, the variable changed must have a single value. Parameters: - name: `string` - - The name of the configuration variable to set. - - Possible Values: - - "GameDirectories" - - "RunUnsafeCommands" + - The specific variable to change. Should be the name of a config variable (not case sensitive). - value: `string` - - The value to set to the variable. + - The new value to set the variable to. Must be parsable into an object that has the same type as the variable. ---