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

utils: add more detailed help message #1813

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

RndelQndel
Copy link

Add more detailed helping message

Example:
uftrace replay --help
COMMAND:
replay Show program excution in the trace data

Each command has detailed helping message for option

Add more detailed helping message

Example:
uftrace replay --help
COMMAND:
  replay		Show program excution in the trace data

Each command has detailed helping message for option

Signed-off-by: Yongrak Choi <[email protected]>
@RndelQndel
Copy link
Author

RndelQndel commented Aug 28, 2023

I can't fill that command alone. Because I didn't know all options.

It just draft and concept.

@RndelQndel RndelQndel marked this pull request as ready for review August 28, 2023 14:47
@MichelleJin12
Copy link
Contributor

Hello, @RndelQndel
Please change utils: add more detailed help message to uftrace: Add more detailed help message.

@@ -1130,6 +1188,49 @@ static void update_subcmd(struct uftrace_opts *opts, char *cmd)
opts->mode = UFTRACE_MODE_INVALID;
}

static int print_subhelp(int beforekey)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should be before_key but I don't know what that means.

@@ -239,6 +239,64 @@ __used static const char uftrace_help[] =
" Try `man uftrace [COMMAND]' for more information.\n"
"\n";

__used static const char uftrace_record_usage[] =
" COMMAND:\n"
" record Run a program and saves the trace data\n"
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It'd be nice to list available options (only for the subcommand) as well.

break;
case UFTRACE_MODE_INVALID:
default:
retval = -3;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What the -3 mean?

@@ -1335,12 +1437,16 @@ static int parse_options(int argc, char **argv, struct uftrace_opts *opts)
update_subcmd(opts, argv[optind]);

if (opts->mode != UFTRACE_MODE_INVALID) {
beforekey = opts->mode;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not use opts->mode directly?

break;
}

return (retval);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't use parenthesis for return statement.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@RndelQndel return retval

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants