-
Notifications
You must be signed in to change notification settings - Fork 4
/
fakenimble.nim
36 lines (33 loc) · 915 Bytes
/
fakenimble.nim
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
#
# Nawabs -- The Anti package manager for Nim
# (c) Copyright 2017 Andreas Rumpf
#
# See the file "license.txt", included in this
# distribution, for details about the copyright.
import os, osproc, parseopt, strutils
import osutils
proc main =
var p = initOptParser()
var action, file, rest = ""
while true:
next(p)
case p.kind
of cmdArgument:
if action.len == 0: action = p.key.normalize
elif file.len == 0: file = p.key
else:
rest = cmdLineRest(p)
break
of cmdLongOption, cmdShortOption:
discard "just ignore options for now"
of cmdEnd: break
case action
of "":
quit "[FakeNimble] version 1.0"
of "path":
exec "nawabs path " & quoteShell(file) & " " & rest
of "c", "cpp", "js", "objc":
exec "nim " & action & " " & quoteShell(file)
else:
quit "[FakeNimble] don't know how to emulate " & action
main()