From b69192b629a454f35eebe23d9ac4f8a5773170fd Mon Sep 17 00:00:00 2001 From: Nikolaus Rath Date: Mon, 10 Oct 2016 09:38:20 -0700 Subject: 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. --- include/fuse.h | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'include/fuse.h') 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 -- cgit v1.2.3