aboutsummaryrefslogtreecommitdiff
path: root/bpkg/cfg-create.hxx
blob: b861732e6fcf9ac905d3b023efd2c45a7d098410 (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
42
43
44
45
46
47
48
49
// file      : bpkg/cfg-create.hxx -*- C++ -*-
// license   : MIT; see accompanying LICENSE file

#ifndef BPKG_CFG_CREATE_HXX
#define BPKG_CFG_CREATE_HXX

#include <bpkg/types.hxx>
#include <bpkg/forward.hxx> // configuration
#include <bpkg/utility.hxx>

#include <bpkg/cfg-create-options.hxx>

namespace bpkg
{
  int
  cfg_create (const cfg_create_options&, cli::scanner& args);

  // Create a new bpkg configuration, initialize its database (add self-link,
  // root repository, etc), and return this configuration information. See
  // bpkg-cfg-create(1) for arguments semantics.
  //
  // If there is a current transaction already open, then stash it before the
  // database initialization and restore it afterwards (used to create private
  // configuration on demand).
  //
  shared_ptr<configuration>
  cfg_create (const common_options&,
              const dir_path&,
              optional<string> name,
              string type,
              const strings& mods,
              const strings& vars,
              bool existing,
              bool wipe,
              optional<uuid> uid = nullopt,
              const optional<dir_path>& host_config = nullopt,
              const optional<dir_path>& build2_config = nullopt);

  default_options_files
  options_files (const char* cmd,
                 const cfg_create_options&,
                 const strings& args);

  cfg_create_options
  merge_options (const default_options<cfg_create_options>&,
                 const cfg_create_options&);
}

#endif // BPKG_CFG_CREATE_HXX