aboutsummaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
Diffstat (limited to 'doc')
-rw-r--r--doc/example.c2
-rw-r--r--doc/interface.md5
2 files changed, 5 insertions, 2 deletions
diff --git a/doc/example.c b/doc/example.c
index 2c21341..324473e 100644
--- a/doc/example.c
+++ b/doc/example.c
@@ -38,7 +38,7 @@ int main(int argc, char **argv)
/* catch any errors and print a default error message. you can do this bit
* yourself, if you'd like more control of the output */
if (result.result_type != SIMPLE_OPT_RESULT_SUCCESS) {
- simple_opt_print_error(stderr, argv[0], result);
+ simple_opt_print_error(stderr, 80, argv[0], result);
return 1;
}
diff --git a/doc/interface.md b/doc/interface.md
index e757e80..f8d5886 100644
--- a/doc/interface.md
+++ b/doc/interface.md
@@ -281,12 +281,15 @@ an alternative method for usage printing.
message, if there is one to be printed:
```
-static void simple_opt_print_error(FILE *f, char *command_name,
+static void simple_opt_print_error(FILE *f, unsigned width, char *command_name,
struct simple_opt_result result);
```
`f` is a file pointer to which the message should be printed.
+`width` is the width to which the output should be word-wrapped. if 0, no
+wrapping will be performed. see `width` in `simple_opt_print_usage` above.
+
`command_name` is the name of the command as it will be printed in the usage
statement. easiest is just to pass `argv[0]` here. if NULL is passed, "err:"
will be printed instead.