aboutsummaryrefslogtreecommitdiff
path: root/bdep/fetch.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2018-03-14 14:58:54 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2018-03-14 14:58:54 +0200
commitb44b4088f48a27bff88f8f010b8cd42303cbdad0 (patch)
tree46c08c1f48a81c3a4dc4c6c59be300e5e40e6762 /bdep/fetch.cxx
parent7acf8ce6111e3740decd39b92c3383fcbdd00e21 (diff)
Implement --fetch|-f and --fetch-full|-F in sync command
Diffstat (limited to 'bdep/fetch.cxx')
-rw-r--r--bdep/fetch.cxx23
1 files changed, 16 insertions, 7 deletions
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<configuration>& 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;