-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.d
42 lines (38 loc) · 1.15 KB
/
app.d
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
import std.stdio;
import lnk;
void main(string[] args)
{
if (args.length < 2) {
stderr.writeln("Expected input file");
return;
}
auto link = new ShellLink(args[1]);
writeln("Description: ", link.description);
writeln("Relative path: ", link.relativePath);
writeln("Working directory: ", link.workingDirectory);
version(Windows) {
writefln("Arguments: %(%s %)", link.arguments);
} else {
writeln("Arguments: ", link.argumentsString);
}
int iconIndex;
auto iconLocation = link.getIconLocation(iconIndex);
writefln("Icon location: %s. Icon index: %s", iconLocation, iconIndex);
auto showCommand = link.showCommand;
string cmdStr;
final switch(showCommand) {
case ShellLink.ShowCommand.normal:
cmdStr = "normal";
break;
case ShellLink.ShowCommand.maximized:
cmdStr = "maximized";
break;
case ShellLink.ShowCommand.minNoActive:
cmdStr = "minimized";
break;
}
writeln("Window show: ", cmdStr);
version(Windows) {
writeln("Resolve: ", link.resolve());
}
}