--- a/fancycmd.py Fri Jun 26 09:55:34 2009 +0300
+++ b/fancycmd.py Fri Jun 26 10:03:21 2009 +0300
@@ -99,7 +99,8 @@
globalopts)
ui.verbose = globaloptions['verbose']
- ui.quiet = globaloptions['quiet']
+ # see UI.__init__ for explanation
+ ui.quiet = (not ui.verbose and globaloptions['quiet'])
if globaloptions['help']:
return cmdtable['help'][0](ui, cmd)
@@ -201,7 +202,8 @@
def __init__(self, verbose=False, quiet=False):
self.verbose = verbose
- self.quiet = quiet
+ # disabling quiet in favor of verbose is more safe
+ self.quiet = (not verbose and quiet)
def write(self, *messages):
for m in messages:
--- a/test.py Fri Jun 26 09:55:34 2009 +0300
+++ b/test.py Fri Jun 26 10:03:21 2009 +0300
@@ -17,7 +17,12 @@
Let's try to do that (damn, but what?!)
'''
- print args, opts
+ # test ui
+ ui.write('what the?!\n')
+ ui.warn('this is stderr\n')
+ ui.status('this would be invisible in quiet mode\n')
+ ui.note('this would be visible only in verbose mode\n')
+ ui.write('%s, %s\n' % (args, opts))
cmdtable = {
'simple':