autocomplete eco
Your checklist for this pull request
- [x] I've read the guidelines for contributing to this repository.
- [x] I made sure to follow the project's coding style.
- [x] I've documented every
RZ_APIfunction and struct this PR changes. - [x] I've added tests that prove my changes are effective (required for changes to
RZ_API). - [x] I've updated the Rizin book with the relevant information (if needed).
Detailed description
This PR implements autocomplete functionality for the eco command, which allows users to load themes or list available themes. When a user types "eco" and presses TAB, they will now see a list of available theme names as suggestions.
The implementation includes:
- A new callback function
theme_choices_cbthat retrieves the list of available themes - Proper documentation for the function using Doxygen-style comments
- Correct pointer modifiers (
RZ_OWNandRZ_NONNULL) to indicate ownership and nullability - Integration with the existing command system through the YAML configuration
This enhancement improves the user experience by making it easier to discover and use available themes without having to remember their exact names or use the list command first.
...
Test plan
To test this change:
- Build Rizin with the changes
- Run Rizin
- Type "eco" and press TAB
- Verify that a list of available theme names appears as suggestions
- Select a theme name from the suggestions and press Enter
- Verify that the theme is loaded correctly
Demo testing:
https://github.com/user-attachments/assets/3e621fab-3664-4fc8-a135-7ff283872c8b
Closing issues
Closes https://github.com/rizinorg/rizin/pull/5075
Codecov Report
:x: Patch coverage is 0% with 14 lines in your changes missing coverage. Please review.
:white_check_mark: Project coverage is 43.85%. Comparing base (a17da6c) to head (efea6cf).
:warning: Report is 302 commits behind head on dev.
| Files with missing lines | Patch % | Lines |
|---|---|---|
| librz/core/cmd/cmd_eval.c | 0.00% | 14 Missing :warning: |
Additional details and impacted files
| Files with missing lines | Coverage Δ | |
|---|---|---|
| librz/core/cmd_descs/cmd_descs.c | 51.53% <ø> (ø) |
|
| librz/include/rz_cmd.h | 71.42% <ø> (ø) |
|
| librz/core/cmd/cmd_eval.c | 54.76% <0.00%> (-2.11%) |
:arrow_down: |
... and 10 files with indirect coverage changes
Continue to review full report in Codecov by Sentry.
Legend - Click here to learn more
Δ = absolute <relative> (impact),ø = not affected,? = missing dataPowered by Codecov. Last update a17da6c...efea6cf. Read the comment docs.
:rocket: New features to boost your workflow:
- :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
- :package: JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
@gargpratyush please add a test
Superseded by https://github.com/rizinorg/rizin/pull/5488