aboutsummaryrefslogtreecommitdiffstats
path: root/simple-opt.h
diff options
context:
space:
mode:
authorkatherine <shmibs@shmibbles.me>2018-03-25 13:13:38 -0700
committerkatherine <shmibs@shmibbles.me>2018-03-25 13:13:38 -0700
commitb72f0a2f2657356286f0eda7408b5816561bccb7 (patch)
tree4161db8b1ab656b663dd2eaf94f82a787f333aac /simple-opt.h
parent86071ec611fdaad93e7fe0e1a24007bdb8dc6fda (diff)
downloadsimple-opt-b72f0a2f2657356286f0eda7408b5816561bccb7.tar.gz
update documentation
Diffstat (limited to 'simple-opt.h')
-rw-r--r--simple-opt.h11
1 files changed, 7 insertions, 4 deletions
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