From b44b4088f48a27bff88f8f010b8cd42303cbdad0 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 14 Mar 2018 14:58:54 +0200 Subject: Implement --fetch|-f and --fetch-full|-F in sync command --- bdep/fetch.cxx | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) (limited to 'bdep/fetch.cxx') diff --git a/bdep/fetch.cxx b/bdep/fetch.cxx index 6231d8b..26a0292 100644 --- a/bdep/fetch.cxx +++ b/bdep/fetch.cxx @@ -11,6 +11,21 @@ using namespace std; namespace bdep { + void + cmd_fetch (const common_options& o, + const dir_path& prj, + const shared_ptr& c, + bool full) + { + // Let's use the repository name rather than the location as a sanity + // check (the repository must have been added as part of init). + // + run_bpkg (o, + "fetch", + "-d", c->path, + (full ? nullptr : ("dir:" + prj.string ()).c_str ())); + } + int cmd_fetch (const cmd_fetch_options& o, cli::scanner&) { @@ -45,13 +60,7 @@ namespace bdep first = false; } - // Let's use the repository name rather than the location as a sanity - // check (the repository must have been added as part of init). - // - run_bpkg (o, - "fetch", - "-d", c->path, - (o.full () ? nullptr : ("dir:" + prj.string ()).c_str ())); + cmd_fetch (o, prj, c, o.full ()); } return 0; -- cgit v1.1