Skip to content

Commit 36e6a5b

Browse files
pranitbauva1997gitster
authored andcommitted
test-parse-options: print quiet as integer
We would want to see how multiple --quiet options affect the value of the underlying variable (we may want "--quiet --quiet" to still be 1, or we may want to see the value incremented to 2). Show the value as integer to allow us to inspect it. Signed-off-by: Pranit Bauva <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 8425b7e commit 36e6a5b

File tree

2 files changed

+14
-14
lines changed

2 files changed

+14
-14
lines changed

t/t0040-parse-options.sh

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ timestamp: 0
6464
string: (not set)
6565
abbrev: 7
6666
verbose: 0
67-
quiet: no
67+
quiet: 0
6868
dry run: no
6969
file: (not set)
7070
EOF
@@ -164,7 +164,7 @@ timestamp: 0
164164
string: 123
165165
abbrev: 7
166166
verbose: 2
167-
quiet: no
167+
quiet: 0
168168
dry run: yes
169169
file: prefix/my.file
170170
EOF
@@ -184,7 +184,7 @@ timestamp: 0
184184
string: 321
185185
abbrev: 10
186186
verbose: 2
187-
quiet: no
187+
quiet: 0
188188
dry run: no
189189
file: prefix/fi.le
190190
EOF
@@ -212,7 +212,7 @@ timestamp: 0
212212
string: 123
213213
abbrev: 7
214214
verbose: 0
215-
quiet: no
215+
quiet: 0
216216
dry run: no
217217
file: (not set)
218218
arg 00: a1
@@ -235,7 +235,7 @@ timestamp: 0
235235
string: (not set)
236236
abbrev: 7
237237
verbose: 0
238-
quiet: no
238+
quiet: 0
239239
dry run: no
240240
file: (not set)
241241
EOF
@@ -264,7 +264,7 @@ timestamp: 0
264264
string: 123
265265
abbrev: 7
266266
verbose: 0
267-
quiet: no
267+
quiet: 0
268268
dry run: no
269269
file: (not set)
270270
EOF
@@ -303,7 +303,7 @@ timestamp: 0
303303
string: (not set)
304304
abbrev: 7
305305
verbose: 0
306-
quiet: no
306+
quiet: 0
307307
dry run: no
308308
file: (not set)
309309
arg 00: --quux
@@ -323,7 +323,7 @@ timestamp: 1
323323
string: (not set)
324324
abbrev: 7
325325
verbose: 0
326-
quiet: yes
326+
quiet: 1
327327
dry run: no
328328
file: (not set)
329329
arg 00: foo
@@ -345,7 +345,7 @@ timestamp: 0
345345
string: (not set)
346346
abbrev: 7
347347
verbose: 0
348-
quiet: no
348+
quiet: 0
349349
dry run: no
350350
file: (not set)
351351
EOF
@@ -374,7 +374,7 @@ timestamp: 0
374374
string: (not set)
375375
abbrev: 7
376376
verbose: 0
377-
quiet: no
377+
quiet: 0
378378
dry run: no
379379
file: (not set)
380380
EOF
@@ -399,7 +399,7 @@ timestamp: 0
399399
string: (not set)
400400
abbrev: 7
401401
verbose: 0
402-
quiet: no
402+
quiet: 0
403403
dry run: no
404404
file: (not set)
405405
EOF
@@ -430,7 +430,7 @@ timestamp: 0
430430
string: (not set)
431431
abbrev: 7
432432
verbose: 0
433-
quiet: no
433+
quiet: 0
434434
dry run: no
435435
file: (not set)
436436
EOF
@@ -449,7 +449,7 @@ timestamp: 0
449449
string: (not set)
450450
abbrev: 7
451451
verbose: 0
452-
quiet: no
452+
quiet: 0
453453
dry run: no
454454
file: (not set)
455455
EOF

test-parse-options.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ int main(int argc, char **argv)
9090
printf("string: %s\n", string ? string : "(not set)");
9191
printf("abbrev: %d\n", abbrev);
9292
printf("verbose: %d\n", verbose);
93-
printf("quiet: %s\n", quiet ? "yes" : "no");
93+
printf("quiet: %d\n", quiet);
9494
printf("dry run: %s\n", dry_run ? "yes" : "no");
9595
printf("file: %s\n", file ? file : "(not set)");
9696

0 commit comments

Comments
 (0)