-
Notifications
You must be signed in to change notification settings - Fork 429
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for optional and params T[]
toolshed command arguments.
#5573
Open
ElectroJr
wants to merge
24
commits into
space-wizards:master
Choose a base branch
from
ElectroJr:opt-args
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ElectroJr
added
Status: Requires Content PR
This PR breaks content and requires both to be merged together.
Status: Needs Review
This PR needs to be reviewed before it can be merged.
Toolshed
labels
Dec 23, 2024
The command arguments call the the "other" entity the "target"
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Status: Needs Review
This PR needs to be reviewed before it can be merged.
Status: Requires Content PR
This PR breaks content and requires both to be merged together.
Toolshed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR allows toolshed commands to use optional and
params T[]
arguments. Optional & variable-length arguments can be truncated using the command terminator ';' or the new explicit pipe symbol '|'. The pipe symbol conflicts with some existing bitwise or commands (|' and
|~'), so I just removed the symbolic "name" for those commands. Due to the renaming, this needs a space-wizards/space-station-14/pull/34029 so that theAllCommandsHavePermissions
test passes.I've tried briefly looking around, but didn't find a lot about how to use reflection to check for params collections in .net 9. So I'm not sure how hard it'd be to update or if the current implementation (checking for
ParamArrayAttribute
) would cause any issues.This PR also makes varous other toolshed related changes, including:
CommandArgument
struct.i { i 2 ; }
is no longer a valid command, as the block has no return value.<name (Type)>
for mandatory arguments[name (Type)]
for optional arguments[name (Type)]...
for variable length arguments (i.e., forparams T[]
)help
andexplain
commands have changed to try make the output more readable, and so that they also specify whether a command requires type arguments. E.g., thecomp:get
command now shows up ascomp:get<T>
.