From b72f0a2f2657356286f0eda7408b5816561bccb7 Mon Sep 17 00:00:00 2001 From: katherine Date: Sun, 25 Mar 2018 13:13:38 -0700 Subject: update documentation --- simple-opt.h | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'simple-opt.h') diff --git a/simple-opt.h b/simple-opt.h index 9bc1141..0260467 100644 --- a/simple-opt.h +++ b/simple-opt.h @@ -96,8 +96,8 @@ struct simple_opt_result { static struct simple_opt_result simple_opt_parse(int argc, char **argv, struct simple_opt *options); -static void simple_opt_print_usage(FILE *f, unsigned width, char *command_name, - char *command_options, char *command_summary, +static void simple_opt_print_usage(FILE *f, unsigned width, + char *command_name, char *command_options, char *command_summary, struct simple_opt *options); static void simple_opt_print_error(FILE *f, char *command_name, @@ -525,8 +525,8 @@ static int sub_simple_opt_wrap_print(FILE *f, unsigned width, unsigned col, return col; } -static void simple_opt_print_usage(FILE *f, unsigned width, char *command_name, - char *command_options, char *command_summary, +static void simple_opt_print_usage(FILE *f, unsigned width, + char *command_name, char *command_options, char *command_summary, struct simple_opt *options) { char print_buffer[SIMPLE_OPT_USAGE_PRINT_BUFFER_WIDTH]; @@ -747,6 +747,9 @@ static void simple_opt_print_error(FILE *f, char *command_name, char *s; unsigned i; + if (result.result_type == SIMPLE_OPT_RESULT_SUCCESS) + return; + if (command_name != NULL) fprintf(f, "%s: ", command_name); else -- cgit v1.2.3