FUSE_PARSE_CMDLINE(3) | Library Functions Manual | FUSE_PARSE_CMDLINE(3)

# NAME

`fuse_parse_cmdline` — FUSE helper function to parse command line arguments

# SYNOPSIS

library “libfuse”
`#include <fuse.h>`

int
`fuse_parse_cmdline`(struct fuse_args *args, char **mp, int *mt, int *fg);

# DESCRIPTION

`fuse_parse_cmdline`() is a helper function to parse standard FUSE arguments. args can be constructed using the FUSE_ARGS_INIT(3) macro.

`fuse_parse_cmdline`() supports the following arguments.

`-d`, `-odebug`
  Causes debug information for subsequent FUSE library calls to be output to stderr. Implies `-f`.
`-f`
  If this is specified then fg will be set to 1 on success. This flag indicates that the file system should not detach from the controlling terminal and run in the foreground.
`-h`, `--help`, `-ho`
  Print usage information for the options supported by `fuse_parse_cmdline`().
`-s`
  If this is specified then mt will be set to 0 on success. This flag indicates that the file system should be run in multi-threaded mode. `-s` is currently ignored and mt will always be 0.
`-V`, `--version`
  Print the FUSE library version to stderr.

If the first argument not recognised by `fuse_parse_cmdline`() is a valid directory then mp will be set to the canonicalized absolute pathname of this directory.

# RETURN VALUES

The `fuse_parse_cmdline`() function returns 0 on success or -1 if `-h`, `--help`, `-ho`, `-v` or `--version` are included in argv or mp does not exist or is not a directory.

# SEE ALSO

FUSE_ARGS_INIT(3), fuse_daemonize(3), fuse_main(3), fuse_setup(3)

# STANDARDS

The `fuse_parse_cmdline`() function conforms to FUSE 2.6.

# HISTORY

The `fuse_parse_cmdline`() function first appeared in OpenBSD 5.4.

# AUTHORS

Sylvestre Gallon <ccna.syl@gmail.com>
Helg Bredow <helg@openbsd.org>

September 23, 2025 | Debian