aboutsummaryrefslogtreecommitdiffstats
path: root/doc/interface.md
diff options
context:
space:
mode:
authorkatherine <shmibs@shmibbles.me>2018-03-18 11:42:45 -0700
committerkatherine <shmibs@shmibbles.me>2018-03-18 11:42:45 -0700
commit424baa89f475b6f80f762be504154b48e3ab4443 (patch)
tree28304fabfc997a1fc5d3abd757341582fabc94c0 /doc/interface.md
parent3c5673a2bbba83dbc672b53a20df0dd3f2c457a9 (diff)
downloadsimple-opt-424baa89f475b6f80f762be504154b48e3ab4443.tar.gz
add neglected information
Diffstat (limited to 'doc/interface.md')
-rw-r--r--doc/interface.md38
1 files changed, 38 insertions, 0 deletions
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 <arg_goes_here>
+```
+
+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 <arg_goes_here>
+./a.out --opt-x=<arg_goes_here>
+```
+
+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