-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.d
More file actions
43 lines (36 loc) · 747 Bytes
/
Copy pathmain.d
File metadata and controls
43 lines (36 loc) · 747 Bytes
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
module dip;
import std.stdio;
import std.file;
import std.getopt;
import build;
import resolve_dep;
import globals;
import get;
void main(string[] args) {
getopt(args, std.getopt.config.passThrough
, "verbose|v", &verbose
, "vverbose|vv", &vverbose
, "install|i", &install
, "listdependencies|l", &listdependencies);
auto package_dir = getcwd();
string command = "build";
if (args.length==3) {
command = args[1];
args[1..$-1] = args[2..$];
}
switch (command) {
case "get":
getpackage(args[2]);
break;
case "build":
if (args.length>1) {
package_dir = package_search(args[1]);
}
build_package(package_dir);
case "install":
install = true;
break;
default:
writeln("command unknown");
}
}