Command server language variables
The current state of the command system does not allow for variables, which severely limits its versatility.
To provide support for this, commands may produce "output variables" which contain data that may be assigned to a variable. Example: Hypothetical method http get could produce the output variables status (HTTP status code).
A user can then dictate that a variable be saved by providing a new @ token their command (e.g. http get -url "https://google.com" @status httpcode), then using it with a $ token (echo -message $httpcode).
The $ token will also be able to support string interpolation in the same way as C#, so something like this could be written:
http get -url "https://google.com" @status httpcode
echo -message $"Server responded with HTTP status code {httpcode}."
This includes the use of multiple tokens:
http get -url "https://google.com" @status httpcode
http post -url "https://example.com" -content_type "application/json" -content $$"{ ""code"": {{httpcode}} }"
Where in this example, assuming the HTTP code is 200, content would resolve to { "code": 200 }
A number of reserved variable names will be available for all commands, such as @logs (contains all generated message logs) and @output (a concatenated string of all text message outputs). Additional default variables can be specified through modules.