From 26a360a00c143a60e3bd444c4a5217b54fbdda53 Mon Sep 17 00:00:00 2001 From: Tobias Oberstein Date: Sat, 26 Jul 2014 17:20:47 +0200 Subject: [PATCH] add option to ingore unknown cmd line opts; bump version --- scour/scour.py | 9 +++++---- setup.py | 4 ++-- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/scour/scour.py b/scour/scour.py index 0ef0507..f85a8ed 100644 --- a/scour/scour.py +++ b/scour/scour.py @@ -5,6 +5,7 @@ # # Copyright 2010 Jeff Schiller # Copyright 2010 Louis Simard +# Copyright 2013-2014 Tavendo GmbH # # This file is part of Scour, http://www.codedread.com/scour/ # @@ -70,7 +71,7 @@ except ImportError: pass APP = 'scour' -VER = '0.28' +VER = '0.29' COPYRIGHT = 'Copyright Jeff Schiller, Louis Simard, 2010' NS = { 'SVG': 'http://www.w3.org/2000/svg', @@ -3177,10 +3178,10 @@ def maybe_gziped_file(filename, mode="r"): -def parse_args(args=None): +def parse_args(args=None, ignore_additional_args=False): options, rargs = _options_parser.parse_args(args) - if rargs: + if rargs and not ignore_additional_args: _options_parser.error("Additional arguments not handled: %r, see --help" % rargs) if options.digits < 0: _options_parser.error("Can't have negative significant digits, see --help") @@ -3227,7 +3228,7 @@ def generateDefaultOptions(): def __init__(self, **entries): self.__dict__.update(entries) - d = parse_args()[0].__dict__.copy() + d = parse_args(ignore_additional_args = True)[0].__dict__.copy() return Struct(**d) diff --git a/setup.py b/setup.py index 73a7134..97d11c2 100644 --- a/setup.py +++ b/setup.py @@ -1,6 +1,6 @@ ############################################################################### ## -## Copyright (C) 2013 Tavendo GmbH +## Copyright (C) 2013-2014 Tavendo GmbH ## ## Licensed under the Apache License, Version 2.0 (the "License"); ## you may not use this file except in compliance with the License. @@ -32,7 +32,7 @@ Authors: setup ( name = 'scour', - version = '0.27', + version = '0.29', description = 'Scour SVG Optimizer', # long_description = open("README.md").read(), long_description = LONGDESC,