-
Notifications
You must be signed in to change notification settings - Fork 431
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
base: master
Are you sure you want to change the base?
Conversation
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 <cyl941028@gmail.com>
I can't fill that command alone. Because I didn't know all options. It just draft and concept. |
Hello, @RndelQndel |
@@ -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) |
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.
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" |
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.
It'd be nice to list available options (only for the subcommand) as well.
break; | ||
case UFTRACE_MODE_INVALID: | ||
default: | ||
retval = -3; |
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.
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; |
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.
Why not use opts->mode
directly?
break; | ||
} | ||
|
||
return (retval); |
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.
We don't use parenthesis for return statement.
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.
@RndelQndel return retval
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