* fix: pass original args correctlyl, oops
This commit is contained in:
+3
-3
@@ -63,7 +63,7 @@ def init(database = True, write = True,
|
||||
if ui is None:
|
||||
from pisi.cli import CLI
|
||||
if options:
|
||||
ctx.ui = CLI(options.debug)
|
||||
ctx.ui = CLI(options.debug, options.verbose)
|
||||
else:
|
||||
ctx.ui = CLI()
|
||||
else:
|
||||
@@ -317,12 +317,12 @@ def check(package):
|
||||
for file in files.list:
|
||||
if file.hash and file.type != "config" \
|
||||
and not os.path.islink('/' + file.path):
|
||||
ctx.ui.info(_("Checking %s...") % file.path, False, True)
|
||||
ctx.ui.info(_("Checking %s...") % file.path, noln=False, verbose=True)
|
||||
if file.hash != util.sha1_file('/' + file.path):
|
||||
corrupt.append(file)
|
||||
ctx.ui.info("Corrupt file: %s" % file)
|
||||
else:
|
||||
ctx.ui.info("OK", False)
|
||||
ctx.ui.info("OK", verbose=True)
|
||||
return corrupt
|
||||
|
||||
def index(dirs=None, output='pisi-index.xml', skip_sources=False, skip_signing=False,
|
||||
|
||||
@@ -67,11 +67,9 @@ class CLI(UI):
|
||||
def info(self, msg, verbose = False, noln = False):
|
||||
# TODO: need to look at more kinds of info messages
|
||||
# let's cheat from KDE :)
|
||||
if noln:
|
||||
msgend = ''
|
||||
else:
|
||||
msgend = '\n'
|
||||
self.output( unicode(msg) + msgend, verbose=verbose)
|
||||
if not noln:
|
||||
msg += '\n'
|
||||
self.output(unicode(msg), verbose=verbose)
|
||||
|
||||
def warning(self, msg, verbose = False):
|
||||
msg = unicode(msg)
|
||||
|
||||
+3
-4
@@ -82,13 +82,12 @@ class PreParser(OptionParser):
|
||||
|
||||
class PisiCLI(object):
|
||||
|
||||
def __init__(self, args=None):
|
||||
def __init__(self, orig_args=None):
|
||||
# first construct a parser for common options
|
||||
# this is really dummy
|
||||
self.parser = PreParser(version="%prog " + pisi.__version__)
|
||||
|
||||
try:
|
||||
opts, args = self.parser.parse_args(args=args)
|
||||
opts, args = self.parser.parse_args(args=orig_args)
|
||||
if len(args)==0: # more explicit than using IndexError
|
||||
if 'version' in opts:
|
||||
self.parser.print_version()
|
||||
@@ -100,7 +99,7 @@ class PisiCLI(object):
|
||||
except ParserError:
|
||||
raise Error(_('Command line parsing error'))
|
||||
|
||||
self.command = Command.get_command(cmd_name, args=args)
|
||||
self.command = Command.get_command(cmd_name, args=orig_args)
|
||||
if not self.command:
|
||||
raise Error(_("Unrecognized command: %s") % cmd_name)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user