aboutsummaryrefslogtreecommitdiff
path: root/bpkg/pkg-command
blob: 4706c598b0b1dfc50a677b8d59d38860516a52f7 (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
// file      : bpkg/pkg-command -*- C++ -*-
// copyright : Copyright (c) 2014-2017 Code Synthesis Ltd
// license   : MIT; see accompanying LICENSE file

#ifndef BPKG_PKG_COMMAND
#define BPKG_PKG_COMMAND

#include <bpkg/types>
#include <bpkg/forward> // selected_package
#include <bpkg/utility>

#include <bpkg/configuration-options>

namespace bpkg
{
  // Common pkg-{update,clean,test,install,...} implementation.
  //
  int
  pkg_command (const string& cmd, // Without the 'pkg-' prefix.
               const configuration_options&,
               cli::scanner& args);

  struct pkg_command_vars
  {
    shared_ptr<selected_package> pkg;
    strings vars;
  };

  void
  pkg_command (const string& cmd,
               const dir_path& configuration,
               const common_options&,
               const strings& common_vars,
               const vector<pkg_command_vars>&);
}

#endif // BPKG_PKG_COMMAND