Change behaviour of -f option
This commit is contained in:
parent
a141d740fd
commit
dce7458b09
|
@ -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)
|
||||||
|
|
10
source/app.d
10
source/app.d
|
@ -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;
|
||||||
|
|
Loading…
Reference in New Issue