-
Notifications
You must be signed in to change notification settings - Fork 20
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
Extend CLI functionality #91
Merged
Merged
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
Move to a git-style subcommand interface and add basic support for item searching. raphael-cli solve --item-id XYZ ... raphael-cli search Archeo
KonaeAkira
approved these changes
Nov 22, 2024
if item.can_be_hq { | ||
modified_hq_ingredients[index] = | ||
hq_ingredients[hq_ingredient_index].clamp(0, max_amount as u8); | ||
hq_ingredient_index = hq_ingredient_index.saturating_add(1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i have a feeling that using saturating_add
here might be overkill 😂
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Adds more commands and arguments to the CLI, such as a search function, the ability to specify consumables and HQ ingredients for solving, and the ability to format output in a CSV friendly way. These changes aim to make the CLI less bare-bones and provide features allowing better integration in automated workflows.
The search command and new architecture were implemented by @jfarmer with more features for the search and solve functionality added by me.
Overview:
search
andsolve
search
: Search for items by their name or item IDsolve
: Use the solver to find a solution to a craft--stats
solve
, a variety of variables can be output, depending on the arguments provided by the userCaveats:
solve
command. For the recipe itself, the recipe ID would also work. However, Raphael currently doesn't store it. Since there doesn't seem to be an item where different crafter's recipes differ, this should not be a problem, especially now with the search function/
is typically used when referring to different gear and meld configs. This could be changed if necessaryclap
auto-generates the help text doesn't directly show that stats have to be provided for thesolve
command. Similarly, consumables are parsed with a custom function that doesn't integrate well. They lead to immediate errors, if inputted incorrectly, with a helpful error message, so this should not be too much of an issueExamples:
search
:solve
: