summary refs log tree commit diff stats
path: root/tests/system/tparams.nim
diff options
context:
space:
mode:
Diffstat (limited to 'tests/system/tparams.nim')
-rw-r--r--tests/system/tparams.nim18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/system/tparams.nim b/tests/system/tparams.nim
new file mode 100644
index 000000000..1358212f2
--- /dev/null
+++ b/tests/system/tparams.nim
@@ -0,0 +1,18 @@
+import os
+import osproc
+import parseopt2
+import sequtils
+
+let argv = commandLineParams()
+
+if argv == @[]:
+  # this won't work with spaces
+  assert execShellCmd(getAppFilename() & " \"foo bar\" --aa:bar=a --a=c:d --ab -c --a[baz]:doo") == 0
+else:
+  let f = toSeq(getopt())
+  echo f.repr
+  assert f[0].kind == cmdArgument and f[0].key == "foo bar" and f[0].val == ""
+  assert f[1].kind == cmdLongOption and f[1].key == "aa" and f[1].val == "bar=a"
+  assert f[2].kind == cmdLongOption and f[2].key == "a=c" and f[2].val == "d"
+  assert f[3].kind == cmdLongOption and f[3].key == "ab" and f[3].val == ""
+  assert f[4].kind == cmdShortOption and f[4].key == "c" and f[4].val == ""
serview' href='/akspecs/ranger/commit/ranger/gui/defaultui.py?h=v1.9.2&id=8db3c4b1732b497173e43da782d8c83406fb1a2e'>8db3c4b1 ^
d88232a3 ^

cfdbb9d6 ^
b5393406 ^
06aefcf5 ^

a6791aee ^
d88232a3 ^
a6791aee ^
9506fb8e ^
8db3c4b1 ^



e6dfc442 ^
a6791aee ^
b5393406 ^


ddf828fb ^
a6791aee ^
8db3c4b1 ^
a6791aee ^


c1033553 ^
a6791aee ^
c1033553 ^

a6791aee ^
06aefcf5 ^
42fd3690 ^
a6791aee ^
06aefcf5 ^
d88232a3 ^

1159f9ec ^
49ae0dd1 ^
9506fb8e ^
6f43de0a ^


d88232a3 ^
cfdbb9d6 ^

ea87d005 ^
6f43de0a ^

e6dfc442 ^
06aefcf5 ^
5715beca ^

491a5312 ^
06aefcf5 ^

8db3c4b1 ^
ea87d005 ^
06aefcf5 ^
5715beca ^

491a5312 ^
06aefcf5 ^

8db3c4b1 ^
5715beca ^
06aefcf5 ^

8db3c4b1 ^

06aefcf5 ^

8db3c4b1 ^
ea87d005 ^
7ec262f8 ^

e7733577 ^
e6dfc442 ^

cfdbb9d6 ^
e6dfc442 ^


cfdbb9d6 ^
5715beca ^
e6dfc442 ^
b5393406 ^
4e9450f9 ^



8db3c4b1 ^
b5393406 ^

ea87d005 ^
e07cfa31 ^

ddf828fb ^
b5393406 ^

8db3c4b1 ^
b5393406 ^
ddf828fb ^
e6dfc442 ^
8db3c4b1 ^

ea87d005 ^
9a78b644 ^




a396b3a0 ^

6f43de0a ^
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136