diff options
author | kitsunyan | 2018-06-09 21:52:58 +0000 |
---|---|---|
committer | kitsunyan | 2018-06-09 21:52:58 +0000 |
commit | 4e6a207ce3d764f73ce3294723c263e38d9b68d3 (patch) | |
tree | 4ce825423e15ad74cd3a29fbfca119c6ab8d2b3e /lib/tools.nim | |
parent | 7accdb6dab38f0ecb49669b7ddc04dc4f5facd14 (diff) |
Refactor tools
Diffstat (limited to 'lib/tools.nim')
-rw-r--r-- | lib/tools.nim | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/lib/tools.nim b/lib/tools.nim new file mode 100644 index 0000000..82cafff --- /dev/null +++ b/lib/tools.nim @@ -0,0 +1,19 @@ +import os, ospaths +import bisect, install + +let fileName = paramStr(0).splitFile().name +let appName = getAppFilename().splitFile().name + +let paramsFull = commandLineParams() +let (tool, params) = if fileName == appName: + (paramsFull[0], paramsFull[1 .. ^1]) + else: + (fileName, paramsFull) + +programResult = case tool: + of "bisect": + handleBisect(params) + of "install": + handleInstall(params) + else: + 1
\ No newline at end of file |