Skip to content

Commit 3376460

Browse files
committed
Merge pull request #2715 from citruspi/Error-Log-Level-Flag
Differentiate Between Quiet Flag Counts
2 parents bd39f99 + 3a340bc commit 3376460

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

pip/basecommand.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,12 @@ def main(self, args):
109109
options, args = self.parse_args(args)
110110

111111
if options.quiet:
112-
level = "WARNING"
112+
if options.quiet == 1:
113+
level = "WARNING"
114+
if options.quiet == 2:
115+
level = "ERROR"
116+
else:
117+
level = "CRITICAL"
113118
elif options.verbose:
114119
level = "DEBUG"
115120
else:

tests/unit/test_options.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,14 @@ def test_quiet(self):
196196
options2, args2 = main(['fake', '--quiet'])
197197
assert options1.quiet == options2.quiet == 1
198198

199+
options3, args3 = main(['--quiet', '--quiet', 'fake'])
200+
options4, args4 = main(['fake', '--quiet', '--quiet'])
201+
assert options3.quiet == options4.quiet == 2
202+
203+
options5, args5 = main(['--quiet', '--quiet', '--quiet', 'fake'])
204+
options6, args6 = main(['fake', '--quiet', '--quiet', '--quiet'])
205+
assert options5.quiet == options6.quiet == 3
206+
199207
def test_log(self):
200208
options1, args1 = main(['--log', 'path', 'fake'])
201209
options2, args2 = main(['fake', '--log', 'path'])

0 commit comments

Comments
 (0)