From 3df49111ab37729c8a8f59af0521d3d8a75b45ce Mon Sep 17 00:00:00 2001 From: calvin Date: Tue, 9 Nov 2004 19:03:33 +0000 Subject: [PATCH] ignore illegal encoding in 'none' logger, and improve error output of -o option git-svn-id: https://linkchecker.svn.sourceforge.net/svnroot/linkchecker/trunk/linkchecker@1953 e7d03fd6-7b0d-0410-9947-9c21f3af8025 --- linkchecker | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/linkchecker b/linkchecker index 28195ef1..5c2a5a5e 100755 --- a/linkchecker +++ b/linkchecker @@ -421,11 +421,13 @@ if options.output: logtype, encoding = options.output.split("/", 1) else: logtype, encoding = options.output, "iso-8859-15" - if linkcheck.Loggers.has_key(logtype) and has_encoding(encoding): - config['logger'] = config.logger_new(logtype, encoding=encoding) - else: - printUsage(_("Illegal argument %r for option %s") % \ - (options.output, "'-o, --output'")) + if not linkcheck.Loggers.has_key(logtype): + printUsage(_("Illegal logger type %r in %r for option %s") % \ + (logtype, options.output, "'-o, --output'")) + if logtype != 'none' and not has_encoding(encoding): + printUsage(_("Illegal encoding %r in %r for option %s") % \ + (encoding, options.output, "'-o, --output'")) + config['logger'] = config.logger_new(logtype, encoding=encoding) if options.fileoutput: ns = {'fileoutput': 1} for arg in options.fileoutput: