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: dtagfs <source> <mount point> [-f] [-o option[,options...]]`
-f: fork to background
-f: don't fork to background
## Supported tag sources
* 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()];
string[] mountOptions;
bool fork;
bool foreground;
arraySep = ",";
auto options = getopt(
args,
"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 fuse = new Fuse("dtagfs", !fork, false);
auto fuse = new Fuse("dtagfs", foreground, false);
fuse.mount(filesystem, mountPoint, options);
return filesystem;

View File

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