aboutsummaryrefslogtreecommitdiff
path: root/bdep/update.hxx
blob: e93ec34ec789775c8c02736fa783715377bb3b21 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
// file      : bdep/update.hxx -*- C++ -*-
// license   : MIT; see accompanying LICENSE file

#ifndef BDEP_UPDATE_HXX
#define BDEP_UPDATE_HXX

#include <bdep/types.hxx>
#include <bdep/utility.hxx>

#include <bdep/build.hxx>
#include <bdep/update-options.hxx>

namespace bdep
{
  inline void
  cmd_update (const cmd_update_options& o,
              const shared_ptr<configuration>& c,
              const cstrings& pkgs,
              const strings& cfg_vars)
  {
    run_bpkg (2,
              o,
              (o.jobs_specified ()
               ? strings ({"-j", to_string (o.jobs ())})
               : strings ()),
              "update",
              "-d", c->path,
              (o.immediate () ? "--immediate" :
               o.recursive () ? "--recursive" : nullptr),
              cfg_vars,
              pkgs);
  }

  inline int
  cmd_update (const cmd_update_options& o, cli::scanner& args)
  {
    return cmd_build (o, &cmd_update, args);
  }
}

#endif // BDEP_UPDATE_HXX