Change behaviour of -f option

This commit is contained in:
Les De Ridder 2016-11-08 04:35:22 +01:00
parent a141d740fd
commit dce7458b09
No known key found for this signature in database
GPG Key ID: 5EC132DFA85DB372
3 changed files with 8 additions and 8 deletions

View File

@ -9,7 +9,7 @@ See [example.md](example.md).
## Usage ## Usage
`usage: dtagfs <source> <mount point> [-f] [-o option[,options...]]` `usage: dtagfs <source> <mount point> [-f] [-o option[,options...]]`
-f: fork to background -f: don't fork to background
## Supported tag sources ## Supported tag sources
* Dublin Core (XMP), via [exempi-d](https://github.com/lesderid/exempi-d) * Dublin Core (XMP), via [exempi-d](https://github.com/lesderid/exempi-d)

View File

@ -26,23 +26,23 @@ void main(string[] args)
TagProvider[] tagProviders = [new DublinCoreTagProvider()]; TagProvider[] tagProviders = [new DublinCoreTagProvider()];
string[] mountOptions; string[] mountOptions;
bool fork; bool foreground;
arraySep = ","; arraySep = ",";
auto options = getopt( auto options = getopt(
args, args,
"o", &mountOptions, "o", &mountOptions,
"f|fork", &fork "f|foreground", &foreground
); );
auto filesystem = mount(source, mountPoint, tagProviders, mountOptions, fork); auto filesystem = mount(source, mountPoint, tagProviders, mountOptions, foreground);
} }
FileSystem mount(string source, string mountPoint, TagProvider[] tagProviders, string[] options, bool fork) FileSystem mount(string source, string mountPoint, TagProvider[] tagProviders, string[] options, bool foreground)
{ {
auto filesystem = new FileSystem(source, tagProviders); auto filesystem = new FileSystem(source, tagProviders);
auto fuse = new Fuse("dtagfs", !fork, false); auto fuse = new Fuse("dtagfs", foreground, false);
fuse.mount(filesystem, mountPoint, options); fuse.mount(filesystem, mountPoint, options);
return filesystem; return filesystem;

View File

@ -159,11 +159,11 @@ class FileSystem : Operations
} }
override bool access(const(char)[] path, int mode) override bool access(const(char)[] path, int mode)
{ {
//TODO: Check if this should always be true //TODO: Check if this should always be true
return true; return true;
} }
override string[] readdir(const(char)[] path) override string[] readdir(const(char)[] path)
{ {