From a42150f9a878cb131dd79769cceeaa9deacee40f Mon Sep 17 00:00:00 2001 From: Araq Date: Tue, 28 Aug 2018 12:54:40 +0200 Subject: make parseopt work with DLLs on Unix --- lib/pure/parseopt.nim | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'lib/pure') diff --git a/lib/pure/parseopt.nim b/lib/pure/parseopt.nim index 3a79504db..70319ddf0 100644 --- a/lib/pure/parseopt.nim +++ b/lib/pure/parseopt.nim @@ -227,13 +227,14 @@ proc next*(p: var OptParser) {.rtl, extern: "npo$1".} = inc p.idx p.pos = 0 -proc cmdLineRest*(p: OptParser): TaintedString {.rtl, extern: "npo$1".} = - ## retrieves the rest of the command line that has not been parsed yet. - var res = "" - for i in p.idx.. p.idx: res.add ' ' - res.add quote(p.cmds[i]) - result = res.TaintedString +when declared(os.paramCount): + proc cmdLineRest*(p: OptParser): TaintedString {.rtl, extern: "npo$1".} = + ## retrieves the rest of the command line that has not been parsed yet. + var res = "" + for i in p.idx.. p.idx: res.add ' ' + res.add quote(p.cmds[i]) + result = res.TaintedString iterator getopt*(p: var OptParser): tuple[kind: CmdLineKind, key, val: TaintedString] = ## This is an convenience iterator for iterating over the given OptParser object. -- cgit 1.4.1-2-gfad0 c03ecbbf434'>refs log tree commit diff stats
blob: 8c0b9dc130495b7e690111392e276ec13697506d (plain) (blame)
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
43
44
45
46