diff --git a/dotdrop/options.py b/dotdrop/options.py index d36025f..cb41914 100644 --- a/dotdrop/options.py +++ b/dotdrop/options.py @@ -109,9 +109,11 @@ class Options(AttrMonitor): """constructor @args: argument dictionary (if None use sys) """ - self.args = args + self.args = {} if not args: self.args = docopt(USAGE, version=VERSION) + if args: + self.args = args.copy() self.log = Logger() self.debug = self.args['--verbose'] or ENV_DEBUG in os.environ self.dry = self.args['--dry'] diff --git a/tests-ng/ignore-empty.sh b/tests-ng/ignore-empty.sh index fe8dbf1..df80274 100755 --- a/tests-ng/ignore-empty.sh +++ b/tests-ng/ignore-empty.sh @@ -76,7 +76,7 @@ _EOF # create the dotfile mkdir -p ${tmps}/dotfiles/d1 -echo "{{@@ var1 @@}}" > ${tmps}/dotfiles/d1/empty +echo "{#@@ should be stripped @@#}" > ${tmps}/dotfiles/d1/empty echo "not empty" > ${tmps}/dotfiles/d1/notempty # install diff --git a/tests/helpers.py b/tests/helpers.py index d8cef2a..ed2ae0e 100644 --- a/tests/helpers.py +++ b/tests/helpers.py @@ -158,7 +158,6 @@ def load_options(confpath, profile): o.import_link = LinkTypes.NOLINK o.install_showdiff = True o.debug = True - o.variables = {} return o diff --git a/tests/test_install.py b/tests/test_install.py index 5ba35cb..0f0ce66 100644 --- a/tests/test_install.py +++ b/tests/test_install.py @@ -186,7 +186,6 @@ exec bspwm o = load_options(confpath, profile) o.safe = False o.install_showdiff = True - o.variables = {} cmd_install(o) # now compare the generated files