Skip to content
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 proper help for eprintf usages #20047

Closed
trufae opened this issue May 5, 2022 · 6 comments
Closed

Add proper help for eprintf usages #20047

trufae opened this issue May 5, 2022 · 6 comments
Assignees
Milestone

Comments

@trufae
Copy link
Collaborator

trufae commented May 5, 2022

Find out which ones require some work by doing this:

$ git grep 'eprintf' | grep Usage

we have sys/counter.sh too

@trufae trufae added this to the 5.7.0 milestone May 5, 2022
@qascade
Copy link

qascade commented May 11, 2022

I always wanted to contribute to this project. May I give this a try? Will add more options to syscmds Usage listed in syscmd.c as per manpages.

@trufae
Copy link
Collaborator Author

trufae commented May 11, 2022

Sure! feel free to contribute on this! it's a good first issue but this task is about using the r_core_help apis instead of eprintf() for all the eprintf ("Usage") lines.

On manpage-style, i would go for markdown (r2 have a markdown parser already), and it can also read the r2book as a manpage, so better to document such large things in there imho, not inline in the program

@qascade
Copy link

qascade commented May 11, 2022

@trufae Thank you for the clarification. I will ping again for any queries as I am new to this project. Is there any advice from your side, anything I should know before starting working on this.

@trufae trufae modified the milestones: 5.7.0, 5.7.2 May 30, 2022
@Lazula
Copy link
Collaborator

Lazula commented Jun 3, 2022

@qascade Just want to inform you of the existence of r_core_cmd_help_match() and r_core_cmd_help_match_spec(), as they were both created specifically to assist with this kind of task.

Declarations:

$ git grep -n 'r_core_cmd_help[^ ]*('
libr/core/cmd.c:357:R_API void r_core_cmd_help(const RCore *core, const char *help[]) {
libr/core/cmd.c:362:R_API void r_core_cmd_help_match(const RCore *core, const char *help[], R_BORROW R_NONNULL char *cmd, bool exact) {
libr/core/cmd.c:366:R_API void r_core_cmd_help_match_spec(const RCore *core, const char *help[], R_BORROW R_NONNULL char *cmd, char spec, bool exact) {
libr/core/cmd_print.c:7682:                              r_core_cmd_help(core, help_msg_p6);
libr/include/r_core.h:876:R_API void r_core_cmd_help(const RCore *core, const char *help[]);
libr/include/r_core.h:877:R_API void r_core_cmd_help_json(const RCore *core, const char *help[]);
libr/include/r_core.h:878:R_API void r_core_cmd_help_match(const RCore *core, const char *help[], R_BORROW R_NONNULL char *cmd, bool exact);
libr/include/r_core.h:879:R_API void r_core_cmd_help_match_spec(const RCore *core, const char *help[], R_BORROW R_NONNULL char *cmd, char spec, bool exact);

You can find usage with git grep 'r_core_cmd_help_match '.

@trufae trufae modified the milestones: 5.7.2, 5.7.4, 5.8.0 Jun 20, 2022
@trufae trufae modified the milestones: 5.8.2, 5.8.4 Dec 26, 2022
@radare
Copy link
Collaborator

radare commented Mar 2, 2023

Reference commit for anyone who wants to contribute: #21418

$ sys/counters.sh|grep eUsa
eUsage	     177

lets make this number down to zero!

@Lazula Lazula self-assigned this Mar 8, 2023
@trufae
Copy link
Collaborator Author

trufae commented Apr 9, 2023

I think @Lazula fixed them all. Except the ones in utils like syscmd stuff. Maybe those helps should be implemented in core. But we are 90% good on this now. Thanks for the amazing contribs!

@trufae trufae closed this as completed Oct 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants