diff --git a/vcspull/cli.py b/vcspull/cli.py index 34d7cce6..17245f9c 100644 --- a/vcspull/cli.py +++ b/vcspull/cli.py @@ -71,8 +71,14 @@ def cli(log_level): @click.argument('repo_terms', nargs=-1) @click.option('--run-async', '-a', is_flag=True, help='Run repo syncing concurrently (experimental)') -def update(repo_terms, run_async): - configs = load_configs(find_config_files(include_home=True)) +@click.option('config', '-c', type=click.Path(exists=True), + help='Specify config') +def update(repo_terms, run_async, config): + print(config) + if config: + configs = load_configs([config]) + else: + configs = load_configs(find_config_files(include_home=True)) found_repos = [] if repo_terms: @@ -112,8 +118,6 @@ def clamp(n, _min, _max): def update_repo(repo_dict): - if 'url' not in repo_dict: # normalize vcs/repo key - repo_dict['url'] = repo_dict['repo'] r = create_repo(**repo_dict) log.debug('%s' % r) r.update_repo() diff --git a/vcspull/config.py b/vcspull/config.py index fc84c0d3..6ea7c157 100644 --- a/vcspull/config.py +++ b/vcspull/config.py @@ -31,9 +31,10 @@ def expand_dir(_dir, cwd=os.getcwd()): :type dir: string :rtype; string """ + _dir = os.path.expanduser(os.path.expandvars(_dir)) if not os.path.isabs(_dir): _dir = os.path.normpath(os.path.join(cwd, _dir)) - return os.path.expanduser(os.path.expandvars(_dir)) + return _dir def extract_repos(config, cwd=os.getcwd()): @@ -64,7 +65,7 @@ def extract_repos(config, cwd=os.getcwd()): ''' if isinstance(repo_data, string_types): - conf['url'] = repo_data, cwd + conf['url'] = repo_data else: conf = update_dict(conf, repo_data) diff --git a/vcspull/repo/__init__.py b/vcspull/repo/__init__.py index b8e41559..cb4b9943 100644 --- a/vcspull/repo/__init__.py +++ b/vcspull/repo/__init__.py @@ -29,7 +29,7 @@ logger.addHandler(channel) -def create_repo(url, *args, **kwargs): +def create_repo(url, **kwargs): r"""Return object with base class :class:`BaseRepo` depending on url. Return instance of :class:`vcspull.repo.svn.SubversionRepo`,