From 424baa89f475b6f80f762be504154b48e3ab4443 Mon Sep 17 00:00:00 2001 From: katherine Date: Sun, 18 Mar 2018 11:42:45 -0700 Subject: add neglected information --- doc/interface.md | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) (limited to 'doc') diff --git a/doc/interface.md b/doc/interface.md index 5cb69c8..5e2bb4e 100644 --- a/doc/interface.md +++ b/doc/interface.md @@ -51,6 +51,44 @@ the fields which are set by `simple_opt_parse` are: fields contain the value passed (with the correct field to set being determined by the `type` field shown above). +options of the following types: + +``` + SIMPLE_OPT_BOOL, + SIMPLE_OPT_INT, + SIMPLE_OPT_UNSIGNED, + SIMPLE_OPT_STRING, +``` + +take arguments. if the user passes a short option on the cli, that options +argument is passed as the following cli argument, like so: + +``` +./a.out -x +``` + +if the user passes a long option on the cli, that option's argument can be +passed either as the following cli argument or following an `=` typed at the +end of the argument, like so: + +``` +./a.out --opt-x +./a.out --opt-x= +``` + +arguments acceptable to type `SIMPLE_OPT_BOOL` are `true`, `yes`, or `on`, all +of which result in a value of true, and `false`, `no`, or `off`, which result +in a value of false. + +arguments acceptable to type `SIMPLE_OPT_INT` must be decimal integers (that is +digit-only strings) with an optional leading sign indicator of `-` or `+`. + +arguments acceptable to type `SIMPLE_OPT_UNSIGNED` must be decimal integers +(that is digit-only strings). + +arguments acceptable to type `SIMPLE_OPT_STRING` may be any string of +characters the user passes. + ### struct simple_opt_result -- cgit v1.2.3