choices=['yes', 'no'])
parser.add_argument('--spec-vcs-tag', help='Set/update the VCS tag in the'
'spec file')
- parser.add_argument('--config', default=default_configs, action='append',
+ parser.add_argument('--config', action='append',
help='Config file to use, can be given multiple times')
parser.add_argument('--git-meta', metavar='FILENAME',
help='Write data about the exported revision into '
'FILENAME in json format')
args = parser.parse_args(argv)
args.outdir = os.path.abspath(args.outdir)
+
+ # Use default config files if --config was not defined
+ if args.config is None:
+ args.config = default_configs
+
return args
def main(argv=None):
ok_(not os.path.exists(default_cache), os.listdir('.'))
ok_(os.path.exists('my-repo-cache'), os.listdir('.'))
+ def test_options_config2(self):
+ """Test that empty/non-existent config file is ok"""
+ with open('my.conf', 'w') as conf:
+ conf.write('[foo-section]\n')
+
+ ok_((service(['--url', self.orig_repo.path, '--config', 'my.conf']))
+ == 0)
+
def test_options_git_meta(self):
"""Test the --git-meta option"""
eq_(service(['--url', self.orig_repo.path, '--git-meta=_git_meta']), 0)