cberner / fuser

Filesystem in Userspace (FUSE) for Rust
MIT License
836 stars 114 forks source link

How do I accept a set of `-o` options from user? #196

Closed vi closed 2 years ago

vi commented 2 years ago

Typical FUSE program allows user to specify options like -o allow_other on command line.

However, fuser's mount2 function expects high-level enum-based options interface. Some of the options are not just passed to fusermount, but processed within fuser, so that just mapping everything to MountOption::CUSTOM leaks to broken e.g. allow_other behaviour.

I see internal function that converts from a list of OsStrs (or something), for backward compatibility with deprecated mount, but that function is pub(crate). Should it be more public to allow exposing [some] FUSE options in CLI without repeating them explicitly in all user apps?

cberner commented 2 years ago

I recommend you implement your own argument parsing. For example, see examples/hello.rs. Alternately you can copy that method. I'm not planning to make it public though, because backwards compatibility with the command line arguments used by the userspace of libfuse is not a goal of this project