aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorGravatar Nikolaus Rath <Nikolaus@rath.org>2016-10-10 09:38:20 -0700
committerGravatar Nikolaus Rath <Nikolaus@rath.org>2016-10-10 09:41:17 -0700
commitb69192b629a454f35eebe23d9ac4f8a5773170fd (patch)
tree9225e445a0fac5eb6566b7d383180dfae6013652 /include
parent10e718b8ca78c4e332df9d342cd662bfe3fd2bb5 (diff)
fuse_main(): extend support for printing help
There's now a way to inhibit the "usage" line (which actually got lost in commit 225c12aebf2d), which makes it easier for simply file-systems to generate good-looking --help output.
Diffstat (limited to 'include')
-rw-r--r--include/fuse.h19
1 files changed, 18 insertions, 1 deletions
diff --git a/include/fuse.h b/include/fuse.h
index 719623a..8943835 100644
--- a/include/fuse.h
+++ b/include/fuse.h
@@ -608,13 +608,30 @@ struct fuse_context {
* main() function.
*
* This function does the following:
- * - parses command line options
+ * - parses command line options, and handles --help and
+ * --version
* - installs signal handlers for INT, HUP, TERM and PIPE
* - registers an exit handler to unmount the filesystem on program exit
* - creates a fuse handle
* - registers the operations
* - calls either the single-threaded or the multi-threaded event loop
*
+ * Most file systems will have to parse some file-system specific
+ * arguments before calling this function. It is recommended to do
+ * this with fuse_opt_parse() and a processing function that passes
+ * through any unknown options (this can also be achieved by just
+ * passing NULL as the processing function). That way, the remaining
+ * options can be passed directly to fuse_main().
+ *
+ * To get a list of the options recognized by fuse_main(), look
+ * at the output when running with ``--help``.
+ *
+ * Normally, fuse_main() includes a basic ``usage: `` message in the
+ * --help output. However, if argv[0] is an empty string, the usage
+ * message is suppressed. This can be used by file systems to print
+ * their own usage line first. See hello.c for an example of how to do
+ * this.
+ *
* Note: this is currently implemented as a macro.
*
* @param argc the argument counter passed to the main() function