Skip to content

Commit ec16bf8

Browse files
committed
[ci skip] Fix links to examples
1 parent 2c515b6 commit ec16bf8

File tree

4 files changed

+18
-18
lines changed

4 files changed

+18
-18
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ Use this example to check if the mimeapps library can parse all related files on
4444

4545
dub examples/test.d
4646

47-
### [Mimeapps open](examples/open/source/app.d)
47+
### [Mimeapps open](examples/open.d)
4848

4949
Detect MIME type of file and open it with default application for found type.
5050

@@ -58,7 +58,7 @@ Pass http url to open in web browser:
5858

5959
dub examples/open.d --ask https://github.com/FreeSlave/mimeapps
6060

61-
### [Mimeapps update](examples/update/source/app.d)
61+
### [Mimeapps update](examples/update.d)
6262

6363
Update mimeapps.list file. Since this library is in development, don't use this example to update file associations on your system.
6464
Better make a copy first.

examples/list.d

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,18 @@ import desktopfile.paths;
1010
import mimeapps;
1111

1212
void main(string[] args)
13-
{
13+
{
1414
auto mimeTypes = args[1..$];
15-
15+
1616
auto appPaths = applicationsPaths();
1717
auto provider = new DesktopFileProvider(appPaths);
1818
auto mimeAppsLists = mimeAppsListFiles();
1919
auto mimeInfoCaches = mimeInfoCacheFiles();
20-
20+
2121
writeln("Using application paths: ", appPaths);
2222
writeln("Using mimeapps.list files: ", mimeAppsLists.map!(mimeAppsList => mimeAppsList.fileName));
2323
writeln("Using mimeinfo.cache files: ", mimeInfoCaches.map!(mimeInfoCache => mimeInfoCache.fileName));
24-
24+
2525
foreach(mimeType; mimeTypes) {
2626
auto associatedApps = findAssociatedApplications(mimeType, mimeAppsLists, mimeInfoCaches, provider);
2727
auto defaultApp = findDefaultApplication(mimeType, mimeAppsLists, mimeInfoCaches, provider);

examples/open.d

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,17 +24,17 @@ void main(string[] args)
2424
bool ask;
2525
getopt(args, "ask", "Ask before starting open file in an application", &ask);
2626
auto files = args[1..$];
27-
27+
2828
auto mimeDatabase = new MimeDatabase(mimePaths());
2929
alias MimeDatabase.Match M;
3030
auto match = M.globPatterns|M.magicRules|M.inodeType|M.textFallback|M.octetStreamFallback|M.emptyFileFallback;
31-
31+
3232
auto provider = new DesktopFileProvider(applicationsPaths());
3333
auto mimeAppsLists = mimeAppsListFiles();
3434
auto mimeInfoCaches = mimeInfoCacheFiles();
35-
35+
3636
auto urlRegex = regex(`([a-z]+)://.*`);
37-
37+
3838
foreach(filePath; files) {
3939
Rebindable!(const(MimeType)) mimeType;
4040
string mimeTypeName;
@@ -51,7 +51,7 @@ void main(string[] args)
5151
stderr.writefln("Could not detect MIME type for %s", filePath);
5252
continue;
5353
}
54-
54+
5555
auto defaultApp = findDefaultApplication(mimeTypeName, mimeAppsLists, mimeInfoCaches, provider).rebindable;
5656
if (!defaultApp && mimeType !is null && mimeType.parents().length) {
5757
writefln("Could not find default application for MIME type %s, but it has parent types. Will try them.", mimeTypeName);
@@ -63,17 +63,17 @@ void main(string[] args)
6363
}
6464
}
6565
}
66-
66+
6767
if (defaultApp) {
6868
if (ask) {
6969
auto associatedApps = findAssociatedApplications(mimeTypeName, mimeAppsLists, mimeInfoCaches, provider);
70-
70+
7171
writefln("Choose application to open '%s' of type %s", filePath, mimeTypeName);
7272
writefln("\t0: %s (%s) - default", defaultApp.displayName, defaultApp.fileName);
7373
foreach(i, app; associatedApps) {
7474
writefln("\t%s: %s (%s)", i+1, associatedApps[i].displayName, associatedApps[i].fileName);
7575
}
76-
76+
7777
bool ok;
7878
do {
7979
string input = readln().stripRight;
@@ -94,7 +94,7 @@ void main(string[] args)
9494
}
9595
}
9696
} while(!ok);
97-
97+
9898
} else {
9999
defaultApp.startApplication(filePath);
100100
}

examples/test.d

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ void main()
1212
{
1313
auto mimeListPaths = mimeAppsListPaths();
1414
auto mimeCachePaths = mimeInfoCachePaths();
15-
15+
1616
writeln("Using mimeapps.list files: ", mimeListPaths);
1717
writeln("Using mimeinfo.cache files: ", mimeCachePaths);
18-
18+
1919
foreach(path; mimeListPaths.filter!(p => p.exists)) {
2020
try {
2121
new MimeAppsListFile(path);
@@ -25,7 +25,7 @@ void main()
2525
stderr.writefln("Error reading %s: %s", path, e.msg);
2626
}
2727
}
28-
28+
2929
foreach(path; mimeCachePaths.filter!(p => p.exists)) {
3030
try {
3131
new MimeInfoCacheFile(path);

0 commit comments

Comments
 (0)