Skip to content

feature: move argument requirement out of CommandArgument#489

Merged
Citymonstret merged 1 commit into2.0.0-devfrom
feature/2.0.0/move-requirement
Nov 12, 2023
Merged

feature: move argument requirement out of CommandArgument#489
Citymonstret merged 1 commit into2.0.0-devfrom
feature/2.0.0/move-requirement

Conversation

@Citymonstret
Copy link
Copy Markdown
Member

This moves required and defaultValue out of CommandArgument, into CommandComponent. This reduces the verbosity of the command arguments by no longer forcing multiple static methods to determine whether the argument is required.

Whether an argument is required is now specified when adding the argument to the command. The previous argument methods on the command builder have been replaced by required/optional methods with many different overloads. We no longer have the ability to pass typed default values to the arguments as the command arguments no longer store the default values. We will have to think of a suitable replacement.

To facilitate this movement of data we've had to replace many references to CommandArgument with CommandComponent. To make this easier the CommandTree.Node class has been made less generic and has also been renamed to CommandTree.CommandNode.

Many deprecated methods have been removed as there is no real point in updating them as we'll want to drop them before releasing v2 anyway.

@Citymonstret Citymonstret changed the title Back to 1.9.0-SNAPSHOT feature: move argument requirement out of CommandArgument Nov 11, 2023
@github-actions
Copy link
Copy Markdown

github-actions bot commented Nov 11, 2023

Test Results

  53 files  ±0    53 suites  ±0   7s ⏱️ -1s
231 tests ±0  231 ✔️ ±0  0 💤 ±0  0 ±0 
232 runs  ±0  232 ✔️ ±0  0 💤 ±0  0 ±0 

Results for commit 3a9a00a. ± Comparison against base commit a63f517.

♻️ This comment has been updated with latest results.

@Citymonstret Citymonstret changed the base branch from 1.9.0-dev to 2.0.0-dev November 11, 2023 12:26
@Citymonstret Citymonstret force-pushed the feature/2.0.0/move-requirement branch from 320ce18 to 2e6e3e1 Compare November 11, 2023 12:31
This moves `required` and `defaultValue` out of CommandArgument, into CommandComponent. This reduces the verbosity of the command arguments by no longer forcing multiple static methods to determine whether the argument is required.

Whether an argument is required is now specified when adding the argument to the command. The previous `argument` methods on the command builder have been replaced by `required`/`optional` methods with many different overloads. We no longer have the ability to pass typed default values to the arguments as the command arguments no longer store the default values. We will have to think of a suitable replacement.

To facilitate this movement of data we've had to replace many references to CommandArgument with CommandComponent. To make this easier the CommandTree.Node class has been made less generic and has also been renamed to CommandTree.CommandNode.

Many deprecated methods have been removed as there is no real point in updating them as we'll want to drop them before releasing v2 anyway.
@Citymonstret Citymonstret force-pushed the feature/2.0.0/move-requirement branch from 2e6e3e1 to 3a9a00a Compare November 11, 2023 12:34
@Citymonstret Citymonstret merged commit 83cb78a into 2.0.0-dev Nov 12, 2023
@Citymonstret Citymonstret deleted the feature/2.0.0/move-requirement branch November 12, 2023 07:11
@Citymonstret Citymonstret linked an issue Nov 12, 2023 that may be closed by this pull request
@Citymonstret Citymonstret self-assigned this Nov 14, 2023
This was referenced Nov 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

No open projects
Status: Done

Development

Successfully merging this pull request may close these issues.

Move argument requirement into the tree

1 participant