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