1.\" $OpenBSD: fuse_parse_cmdline.3,v 1.1 2018/11/28 21:19:11 mpi Exp $ 2.\" 3.\" Copyright (c) 2018 Helg Bredow <helg.bredow@openbsd.org> 4.\" 5.\" Permission to use, copy, modify, and distribute this software for any 6.\" purpose with or without fee is hereby granted, provided that the above 7.\" copyright notice and this permission notice appear in all copies. 8.\" 9.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 10.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 11.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 12.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 13.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 14.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 15.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 16.\" 17.Dd $Mdocdate: November 28 2018 $ 18.Dt FUSE_PARSE_CMDLINE 3 19.Os 20.Sh NAME 21.Nm fuse_parse_cmdline 22.Nd FUSE helper function to parse command line arguments 23.Sh SYNOPSIS 24.In fuse.h 25.Ft int 26.Fn fuse_parse_cmdline "struct fuse_args *args" "char **mp" \ 27 "int *mt" "int *fg" 28.Sh DESCRIPTION 29.Fn fuse_parse_cmdline 30is a helper function to parse standard FUSE arguments. 31.Fa args 32can be constructed using the 33.Xr FUSE_ARGS_INIT 3 34macro. 35.Pp 36.Fn fuse_parse_cmdline 37supports the following arguments. 38.Bl -tag -width Ds 39.It Fl d , Fl odebug 40Causes debug information for subsequent FUSE library calls to be output to 41stderr. 42Implies 43.Fl f . 44.It Fl f 45If this is specified then 46.Fa fg 47will be set to 1 on success. 48This flag indicates that the file system 49should not detach from the controlling terminal and run in the foreground. 50.It Fl h , Fl -help , Fl ho 51Print usage information for the options supported by 52.Fn fuse_parse_cmdline . 53.It Fl s 54If this is specified then 55.Fa mt 56will be set to 0 on success. 57This flag indicates that the file system 58should be run in multi-threaded mode. 59.Fl s 60is currently ignored and 61.Fa mt 62will always be 0. 63.It Fl V , Fl -version 64Print the FUSE library version to stderr. 65.El 66.Pp 67If the first argument not recognised by 68.Fn fuse_parse_cmdline 69is a valid directory then 70.Fa mp 71will be set to the canonicalized absolute pathname of this directory. 72.Sh RETURN VALUES 73The 74.Fn fuse_parse_cmdline 75function will return 0 on success and -1 if 76.Fl h , Fl -help , Fl ho , Fl v 77or 78.Fl -version 79are included in 80.Fa argv 81or 82.Fa mp 83does not exist or is not a directory. 84.Sh SEE ALSO 85.Xr FUSE_ARGS_INIT 3 , 86.Xr fuse_daemonize 3 , 87.Xr fuse_main 3 , 88.Xr fuse_setup 3 89.Sh STANDARDS 90The 91.Fn fuse_parse_cmdline 92function conforms to FUSE 2.6. 93.Sh HISTORY 94The 95.Fn fuse_parse_cmdline 96function first appeared in 97.Ox 5.4 . 98.Sh AUTHORS 99.An Sylvestre Gallon Aq Mt ccna.syl@gmail.com 100.An Helg Bredow Aq Mt helg@openbsd.org 101