como 0.1.1 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,366 @@
1
+ ---- CMD: como_subcmd
2
+
3
+ como_subcmd error: Subcommand required for "como_subcmd"...
4
+
5
+ como_subcmd [-p <password>] [-u <username>+] <<subcommand>>
6
+
7
+ Options:
8
+ -p User password.
9
+ -u Username(s).
10
+
11
+ Subcommands:
12
+ add Add file to repo.
13
+ rm Remove file from repo.
14
+ commit Commit (pending) changes to repo.
15
+
16
+
17
+ Copyright (c) 2013 by Como Tester
18
+
19
+ ---- CMD: como_subcmd -p passwd
20
+
21
+ como_subcmd error: Subcommand required for "como_subcmd"...
22
+
23
+ como_subcmd [-p <password>] [-u <username>+] <<subcommand>>
24
+
25
+ Options:
26
+ -p User password.
27
+ -u Username(s).
28
+
29
+ Subcommands:
30
+ add Add file to repo.
31
+ rm Remove file from repo.
32
+ commit Commit (pending) changes to repo.
33
+
34
+
35
+ Copyright (c) 2013 by Como Tester
36
+
37
+ ---- CMD: como_subcmd add
38
+
39
+ como_subcmd error: Option "-f" missing for "como_subcmd add"...
40
+
41
+ Subcommand "add" usage:
42
+ como_subcmd add [-fo] [-u <username>] -f <file>
43
+
44
+ -fo Force operation.
45
+ -u Username.
46
+ -f File.
47
+
48
+
49
+ ---- CMD: como_subcmd add -f
50
+
51
+ como_subcmd error: No argument given for "-f"...
52
+
53
+ Subcommand "add" usage:
54
+ como_subcmd add [-fo] [-u <username>] -f <file>
55
+
56
+ -fo Force operation.
57
+ -u Username.
58
+ -f File.
59
+
60
+
61
+ ---- CMD: como_subcmd add -f file
62
+ Options for: como_subcmd
63
+ Given "help": false
64
+ Given "password": false
65
+ Given "username": false
66
+ Given "terminator": false
67
+ Given "add": true
68
+ Given "rm": false
69
+ Given "commit": false
70
+ Options for: add
71
+ Given "help": false
72
+ Given "force": false
73
+ Given "username": false
74
+ Given "file": true
75
+ Value "file": file
76
+ ---- CMD: como_subcmd -p pass add -f file
77
+ Options for: como_subcmd
78
+ Given "help": false
79
+ Given "password": true
80
+ Value "password": pass
81
+ Given "username": false
82
+ Given "terminator": false
83
+ Given "add": true
84
+ Given "rm": false
85
+ Given "commit": false
86
+ Options for: add
87
+ Given "help": false
88
+ Given "force": false
89
+ Given "username": false
90
+ Given "file": true
91
+ Value "file": file
92
+ ---- CMD: como_subcmd -p pass -u name1 add -f file
93
+
94
+ como_subcmd error: Unknown option "-f"...
95
+
96
+ como_subcmd [-p <password>] [-u <username>+] <<subcommand>>
97
+
98
+ Options:
99
+ -p User password.
100
+ -u Username(s).
101
+
102
+ Subcommands:
103
+ add Add file to repo.
104
+ rm Remove file from repo.
105
+ commit Commit (pending) changes to repo.
106
+
107
+
108
+ Copyright (c) 2013 by Como Tester
109
+
110
+ ---- CMD: como_subcmd -p pass -u name1 - add -f file
111
+ Options for: como_subcmd
112
+ Given "help": false
113
+ Given "password": true
114
+ Value "password": pass
115
+ Given "username": true
116
+ Value "username": ["name1"]
117
+ Given "terminator": true
118
+ Given "add": true
119
+ Given "rm": false
120
+ Given "commit": false
121
+ Options for: add
122
+ Given "help": false
123
+ Given "force": false
124
+ Given "username": false
125
+ Given "file": true
126
+ Value "file": file
127
+ ---- CMD: como_subcmd -p pass add -f file -u user
128
+ Options for: como_subcmd
129
+ Given "help": false
130
+ Given "password": true
131
+ Value "password": pass
132
+ Given "username": false
133
+ Given "terminator": false
134
+ Given "add": true
135
+ Given "rm": false
136
+ Given "commit": false
137
+ Options for: add
138
+ Given "help": false
139
+ Given "force": false
140
+ Given "username": true
141
+ Value "username": user
142
+ Given "file": true
143
+ Value "file": file
144
+ ---- CMD: como_subcmd -p pass add -f file
145
+ Options for: como_subcmd
146
+ Given "help": false
147
+ Given "password": true
148
+ Value "password": pass
149
+ Given "username": false
150
+ Given "terminator": false
151
+ Given "add": true
152
+ Given "rm": false
153
+ Given "commit": false
154
+ Options for: add
155
+ Given "help": false
156
+ Given "force": false
157
+ Given "username": false
158
+ Given "file": true
159
+ Value "file": file
160
+ ---- CMD: como_subcmd -p pass add -f file -fo
161
+ Options for: como_subcmd
162
+ Given "help": false
163
+ Given "password": true
164
+ Value "password": pass
165
+ Given "username": false
166
+ Given "terminator": false
167
+ Given "add": true
168
+ Given "rm": false
169
+ Given "commit": false
170
+ Options for: add
171
+ Given "help": false
172
+ Given "force": true
173
+ Given "username": false
174
+ Given "file": true
175
+ Value "file": file
176
+ ---- CMD: como_subcmd -p pass add -f file -fo -h
177
+
178
+ Subcommand "add" usage:
179
+ como_subcmd add [-fo] [-u <username>] -f <file>
180
+
181
+ -fo Force operation.
182
+ -u Username.
183
+ -f File.
184
+
185
+
186
+ ---- CMD: como_subcmd -p pass add -f file -fo rm
187
+
188
+ como_subcmd error: No default option specified to allow "rm"...
189
+
190
+ Subcommand "add" usage:
191
+ como_subcmd add [-fo] [-u <username>] -f <file>
192
+
193
+ -fo Force operation.
194
+ -u Username.
195
+ -f File.
196
+
197
+
198
+ ---- CMD: como_subcmd add -f file -fo commit
199
+
200
+ como_subcmd error: No default option specified to allow "commit"...
201
+
202
+ Subcommand "add" usage:
203
+ como_subcmd add [-fo] [-u <username>] -f <file>
204
+
205
+ -fo Force operation.
206
+ -u Username.
207
+ -f File.
208
+
209
+
210
+ ---- CMD: como_subcmd -p pass add -f file -fo commit
211
+
212
+ como_subcmd error: No default option specified to allow "commit"...
213
+
214
+ Subcommand "add" usage:
215
+ como_subcmd add [-fo] [-u <username>] -f <file>
216
+
217
+ -fo Force operation.
218
+ -u Username.
219
+ -f File.
220
+
221
+
222
+ ---- CMD: como_subcmd -p pass rm
223
+ Options for: como_subcmd
224
+ Given "help": false
225
+ Given "password": true
226
+ Value "password": pass
227
+ Given "username": false
228
+ Given "terminator": false
229
+ Given "add": false
230
+ Given "rm": true
231
+ Given "commit": false
232
+ Options for: rm
233
+ Given "help": false
234
+ Given "force": false
235
+ Given "file": false
236
+ ---- CMD: como_subcmd -p pass rm commit
237
+
238
+ como_subcmd error: No default option specified to allow "commit"...
239
+
240
+ Subcommand "rm" usage:
241
+ como_subcmd rm [-fo] [-f <file>]
242
+
243
+ -fo Force operation.
244
+ -f File.
245
+
246
+
247
+ ---- CMD: como_subcmd -p pass rm -f commit
248
+ Options for: como_subcmd
249
+ Given "help": false
250
+ Given "password": true
251
+ Value "password": pass
252
+ Given "username": false
253
+ Given "terminator": false
254
+ Given "add": false
255
+ Given "rm": true
256
+ Given "commit": false
257
+ Options for: rm
258
+ Given "help": false
259
+ Given "force": false
260
+ Given "file": true
261
+ Value "file": commit
262
+ ---- CMD: como_subcmd -p pass commit
263
+ Options for: como_subcmd
264
+ Given "help": false
265
+ Given "password": true
266
+ Value "password": pass
267
+ Given "username": false
268
+ Given "terminator": false
269
+ Given "add": false
270
+ Given "rm": false
271
+ Given "commit": true
272
+ Options for: commit
273
+ Given "help": false
274
+ Given "quiet": false
275
+ Given "username": false
276
+ Given "<default>": false
277
+ ---- CMD: como_subcmd -p pass commit dii duu
278
+ Options for: como_subcmd
279
+ Given "help": false
280
+ Given "password": true
281
+ Value "password": pass
282
+ Given "username": false
283
+ Given "terminator": false
284
+ Given "add": false
285
+ Given "rm": false
286
+ Given "commit": true
287
+ Options for: commit
288
+ Given "help": false
289
+ Given "quiet": false
290
+ Given "username": false
291
+ Given "<default>": true
292
+ Value "<default>": ["dii", "duu"]
293
+ ---- CMD: como_subcmd -p pass commit -u user1 dii duu
294
+ Options for: como_subcmd
295
+ Given "help": false
296
+ Given "password": true
297
+ Value "password": pass
298
+ Given "username": false
299
+ Given "terminator": false
300
+ Given "add": false
301
+ Given "rm": false
302
+ Given "commit": true
303
+ Options for: commit
304
+ Given "help": false
305
+ Given "quiet": false
306
+ Given "username": true
307
+ Value "username": user1
308
+ Given "<default>": true
309
+ Value "<default>": ["dii", "duu"]
310
+ ---- CMD: como_subcmd -p pass commit -u user1 dii duu -h
311
+
312
+ Subcommand "commit" usage:
313
+ como_subcmd commit [-q] [-u <username>] [<default>]
314
+
315
+ -q Quiet operation.
316
+ -u Username.
317
+ <default> File(s) to commit.
318
+
319
+
320
+ ---- CMD: como_subcmd -p pass commit -h -u user1 dii duu
321
+
322
+ Subcommand "commit" usage:
323
+ como_subcmd commit [-q] [-u <username>] [<default>]
324
+
325
+ -q Quiet operation.
326
+ -u Username.
327
+ <default> File(s) to commit.
328
+
329
+
330
+ ---- CMD: como_subcmd commit -h -u user1 dii duu -h
331
+
332
+ Subcommand "commit" usage:
333
+ como_subcmd commit [-q] [-u <username>] [<default>]
334
+
335
+ -q Quiet operation.
336
+ -u Username.
337
+ <default> File(s) to commit.
338
+
339
+
340
+ ---- CMD: como_subcmd commit -u user1 dii duu -h
341
+
342
+ Subcommand "commit" usage:
343
+ como_subcmd commit [-q] [-u <username>] [<default>]
344
+
345
+ -q Quiet operation.
346
+ -u Username.
347
+ <default> File(s) to commit.
348
+
349
+
350
+ ---- CMD: como_subcmd -p foo commit foo -- external arguments
351
+ Options for: como_subcmd
352
+ Given "help": false
353
+ Given "password": true
354
+ Value "password": foo
355
+ Given "username": false
356
+ Given "terminator": false
357
+ Given "add": false
358
+ Given "rm": false
359
+ Given "commit": true
360
+ Options for: commit
361
+ Given "help": false
362
+ Given "quiet": false
363
+ Given "username": false
364
+ Given "<default>": true
365
+ Value "<default>": ["foo"]
366
+ External: ["external", "arguments"]
data/test/test_como.rb CHANGED
@@ -11,9 +11,17 @@ def runTest( test )
11
11
  rf = "result/#{test}.txt"
12
12
  gf = "golden/#{test}.txt"
13
13
 
14
- system( "export RUBYLIB=../lib; . test_#{test} > #{rf}" )
14
+ system( "rm -f #{rf}; touch #{rf}" )
15
+
16
+ File.open( "test_#{test}" ).readlines.each do |cmd|
17
+ cmd = cmd.chomp
18
+ next if cmd.empty?
19
+ system( "echo \"---- CMD: #{cmd}\" >> #{rf}" )
20
+ system( "export RUBYLIB=../lib; #{cmd} >> #{rf} 2>&1" )
21
+ end
15
22
 
16
23
  if false
24
+ # if true
17
25
  # Populate golden files after inspection.
18
26
  system( "cp #{rf} #{gf}" )
19
27
  end
@@ -26,13 +34,14 @@ end
26
34
 
27
35
  class ComoTest < Test::Unit::TestCase
28
36
 
29
- def test_options() runTest( "options" ); end
30
- def test_queries() runTest( "queries" ); end
31
- def test_config() runTest( "config" ); end
32
- def test_rule_1() runTest( "rule_1" ); end
33
- def test_rule_2() runTest( "rule_2" ); end
34
- def test_subcmd() runTest( "subcmd" ); end
35
- def test_subcmd_config() runTest( "subcmd_config" ); end
36
- def test_compatible() runTest( "compatible" ); end
37
+ def test_options() runTest( "options" ); end
38
+ def test_queries() runTest( "queries" ); end
39
+ def test_config() runTest( "config" ); end
40
+ def test_rule_1() runTest( "rule_1" ); end
41
+ def test_rule_2() runTest( "rule_2" ); end
42
+ def test_subcmd() runTest( "subcmd" ); end
43
+ def test_subcmd_rule() runTest( "subcmd_rule" ); end
44
+ def test_subcmd_config() runTest( "subcmd_config" ); end
45
+ def test_compatible() runTest( "compatible" ); end
37
46
 
38
47
  end
data/test/test_compatible CHANGED
@@ -1,28 +1,28 @@
1
- como_options
2
- como_options --doc
3
- como_options --doc -f
4
- como_options --doc -f foo
5
- como_options -f
6
- como_options -f dii
7
- como_options -f dii -d
8
- como_options --file dii -d d1
9
- como_options --file dii -d d1 d2
10
- como_options --debug -f dii -d d1
11
- como_options -f dii -d d1 --debug
12
- como_options -f dii -d d1 --debug -m foo
13
- como_options -f dii -d d1 --debug -m foo
14
- como_options -f dii -d d1 --params foo=bar dii=duu
15
- como_options -f dii -d d1 --params foo=bar dii=duu -t
16
- como_options -f dii -d d1 --params foo=bar dii=duu -t duu dii
17
- como_options -f dii -d d1 --params foo=bar dii=duu -t duu dii left over
18
- como_options -f dii -d d1 -t --params foo=bar dii=duu left over
19
- como_options -t duu dii --params foo=bar dii=duu -f dii -d d1 left over
20
- como_options -f dii -d d1 -t duu dii --params foo=bar dii=duu - left over
21
- como_options -f dii -d d1 -t duu dii - left over -- external arguments
22
- como_options -f foo -- external arguments
23
- como_options -f foo -t
24
- como_options -q dii -f foo -t
25
- como_options -d -q dii -f foo -t
26
- como_options -f foo -d dir
27
- como_options -f foo -d dir -h
28
- como_options -h -f foo -d dir
1
+ como_compatible
2
+ como_compatible --doc
3
+ como_compatible --doc -f
4
+ como_compatible --doc -f foo
5
+ como_compatible -f
6
+ como_compatible -f dii
7
+ como_compatible -f dii -d
8
+ como_compatible --file dii -d d1
9
+ como_compatible --file dii -d d1 d2
10
+ como_compatible --debug -f dii -d d1
11
+ como_compatible -f dii -d d1 --debug
12
+ como_compatible -f dii -d d1 --debug -m foo
13
+ como_compatible -f dii -d d1 --debug -m foo
14
+ como_compatible -f dii -d d1 --params foo=bar dii=duu
15
+ como_compatible -f dii -d d1 --params foo=bar dii=duu -t
16
+ como_compatible -f dii -d d1 --params foo=bar dii=duu -t duu dii
17
+ como_compatible -f dii -d d1 --params foo=bar dii=duu -t duu dii left over
18
+ como_compatible -f dii -d d1 -t --params foo=bar dii=duu left over
19
+ como_compatible -t duu dii --params foo=bar dii=duu -f dii -d d1 left over
20
+ como_compatible -f dii -d d1 -t duu dii --params foo=bar dii=duu - left over
21
+ como_compatible -f dii -d d1 -t duu dii - left over -- external arguments
22
+ como_compatible -f foo -- external arguments
23
+ como_compatible -f foo -t
24
+ como_compatible -q dii -f foo -t
25
+ como_compatible -d -q dii -f foo -t
26
+ como_compatible -f foo -d dir
27
+ como_compatible -f foo -d dir -h
28
+ como_compatible -h -f foo -d dir
data/test/test_options CHANGED
@@ -26,3 +26,4 @@ como_options -d -q dii -f foo -t
26
26
  como_options -f foo -d dir
27
27
  como_options -f foo -d dir -h
28
28
  como_options -h -f foo -d dir
29
+ como_options --doc doc1 doc2
@@ -0,0 +1,30 @@
1
+ como_subcmd
2
+ como_subcmd -p passwd
3
+ como_subcmd add
4
+ como_subcmd add -f
5
+ como_subcmd add -f file
6
+ como_subcmd -p pass add -f file
7
+ como_subcmd -p pass -u name1 add -f file
8
+ como_subcmd -p pass -u name1 - add -f file
9
+
10
+ como_subcmd -p pass add -f file -u user
11
+ como_subcmd -p pass add -f file
12
+ como_subcmd -p pass add -f file -fo
13
+ como_subcmd -p pass add -f file -fo -h
14
+ como_subcmd -p pass add -f file -fo rm
15
+ como_subcmd add -f file -fo commit
16
+ como_subcmd -p pass add -f file -fo commit
17
+
18
+ como_subcmd -p pass rm
19
+ como_subcmd -p pass rm commit
20
+ como_subcmd -p pass rm -f commit
21
+
22
+ como_subcmd -p pass commit
23
+ como_subcmd -p pass commit dii duu
24
+ como_subcmd -p pass commit -u user1 dii duu
25
+ como_subcmd -p pass commit -u user1 dii duu -h
26
+ como_subcmd -p pass commit -h -u user1 dii duu
27
+ como_subcmd commit -h -u user1 dii duu -h
28
+ como_subcmd commit -u user1 dii duu -h
29
+
30
+ como_subcmd -p foo commit foo -- external arguments
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: como
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-02-09 00:00:00.000000000 Z
12
+ date: 2014-04-23 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description: ! 'Como provides low manifest command line option parsing and deployment.
15
15
  The command line options are described in compact table format and option values
@@ -31,6 +31,7 @@ files:
31
31
  - Rakefile
32
32
  - lib/como.rb
33
33
  - test/test_subcmd
34
+ - test/como_subcmd_rule
34
35
  - test/test_como.rb
35
36
  - test/como_rule_2
36
37
  - test/test_config
@@ -41,6 +42,7 @@ files:
41
42
  - test/test_rule_2
42
43
  - test/como_queries
43
44
  - test/como_subcmd
45
+ - test/test_subcmd_rule
44
46
  - test/test_options
45
47
  - test/como_subcmd_config
46
48
  - test/como_rule_1
@@ -50,6 +52,7 @@ files:
50
52
  - test/golden/rule_1.txt
51
53
  - test/golden/queries.txt
52
54
  - test/golden/subcmd_config.txt
55
+ - test/golden/subcmd_rule.txt
53
56
  - test/golden/subcmd.txt
54
57
  - test/golden/rule_2.txt
55
58
  - test/golden/compatible.txt