aboutsummaryrefslogtreecommitdiff
path: root/bdep/init.cxx
blob: 1e850b8c0961e12bc645997d8504dc5882378900 (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
// file      : bdep/init.cxx -*- C++ -*-
// copyright : Copyright (c) 2014-2017 Code Synthesis Ltd
// license   : MIT; see accompanying LICENSE file

#include <bdep/init.hxx>

#include <bdep/project.hxx>
#include <bdep/diagnostics.hxx>

using namespace std;

namespace bdep
{
  int
  cmd_init (const cmd_init_options& o, cli::scanner& args)
  {
    tracer trace ("init");

    //@@ TODO: validate project/config options for sub-modes.
    //@@ TODO: print project/package(s) being initialized.

    project_packages pp (
      find_project_packages (o,
                             o.empty () /* ignore_packages */));

    text << pp.project;

    for (const dir_path& d: pp.packages)
      text << "  " << (pp.project / d);

    return 0;
  }
}