aboutsummaryrefslogtreecommitdiff
path: root/bpkg/bpkg.cli
blob: 107ef0af65a135b595994131cec14939f4f899c2 (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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
// file      : bpkg/bpkg.cli
// copyright : Copyright (c) 2014-2016 Code Synthesis Ltd
// license   : MIT; see accompanying LICENSE file

include <bpkg/common.cli>;

"\section=1"
"\name=bpkg"
"\summary=build2 package manager"

namespace bpkg
{
  {
    "<command> <topic> <common-options> <command-options> <command-args>",

    "\h|SYNOPSIS|

     \cb{bpkg --help}\n
     \cb{bpkg --version}\n
     \c{\b{bpkg help} [<command> | <topic>]}\n
     \c{\b{bpkg} [<common-options>] <command> [<command-options>] <command-args>}

     \h|DESCRIPTION|

     The \cb{build2} package manager is used to manipulate configurations,
     packages, and repositories using a set of commands that are summarized
     below.

     For a detailed description of any command or help topic, use the
     \cb{help} command or see the corresponding man page (the man pages have
     the \cb{bpkg-} prefix, for example \l{bpkg-help(1)}). Note also that
     <command-options> and <command-args> can be specified in any order and
     <common-options> can be specified as part of <command-options>."
  }

  // For usage it's nice to see the list of commands on the first page. So
  // let's not put this "extended" description into usage.
  //
  {
    "",
    "",

    "A \i{bpkg configuration} is a directory that will contain packages built
     with similar settings. For example, a configuration can be for a specific
     target (\cb{i686}, \cb{x86_64}), compiler (\cb{clang}, \cb{gcc}) compile
     options (\cb{-O3}, \cb{-g}), and so on. Configurations are relatively
     cheap and can be created and thrown away as needed. Configurations can be
     moved and copied by simply moving and copying the directories. Note,
     however, that a move or copy may render some packages out-of-date. In the
     \cb{build2} build system terms a \cb{bpkg} configuration is an
     amalgamation that contains packages as subprojects.

     A \i{bpkg package} is an archive or directory that contains a \cb{build2}
     project plus a package \cb{manifest} file. \cb{bpkg} can either use
     package archives/directories directly from the filesystem or it can fetch
     archives from repositories.

     A \i{bpkg repository} is a collection of packages as well as prerequisite
     and complement repositories. A repository is identified by its location,
     which can be a local filesystem path or a remote HTTP or HTTPS URL.

     A typical \cb{bpkg} workflow would consist of the following steps.

     \dl|

     \li|\b{Create Configuration}\n

         \
         bpkg create cxx config.cxx=clang++ config.cxx.coptions=-O3 \
           config.install.root=/usr/local config.install.root.sudo=sudo
         \

         |

     \li|\n\b{Add Source Repositories}\n

         \
         bpkg add https://pkg.cppget.org/1/stable
         \

         Repeat this command to add more repositories.
         |

     \li|\n\b{Fetch Available Packages List}\n

         \
         bpkg fetch
         \

         |

     \li|\n\b{Fetch and Build Packages}\n

         \
         bpkg build libfoo bar
         \

         |

     \li|\n\b{Drop Package}\n

         If some packages are no longer needed, we can remove them from the
         configuration.

         \
         bpkg drop libfoo
         \

         |

     \li|\n\b{Refresh Available Packages List}\n

         \
         bpkg fetch
         \

         |

     \li|\n\b{Upgrade Packages}\n

         \
         bpkg build bar
         \

         |

     \li|\n\b{Install Packages}\n

         \
         bpkg install bar
         \

         ||
     "
  }

  class commands
  {
    "\h|COMMANDS|"

    //
    // NOTE: Use the same sentence as in the page's \summary and make
    // sure it is short enough to fit in one line in usage.
    //

    bool help
    {
      "[<topic>]",
      "\l{bpkg-help(1)} \- show help for a command or help topic",
      ""
    }

    bool cfg-create|create
    {
      "\l{bpkg-cfg-create(1)} \- create configuration"
    }

    bool cfg-add|add
    {
      "<rep>",
      "\l{bpkg-cfg-add(1)} \- add repository to configuration",
      ""
    }

    bool cfg-fetch|fetch
    {
      "\l{bpkg-cfg-fetch(1)} \- fetch list of available packages"
    }

    bool pkg-status|status
    {
      "\l{bpkg-pkg-status(1)} \- print package status"
    }

    bool pkg-build|build
    {
      "\l{bpkg-pkg-build(1)} \- build package"
    }

    bool pkg-drop|drop
    {
      "\l{bpkg-pkg-drop(1)} \- drop package"
    }

    bool pkg-install|install
    {
      "\l{bpkg-pkg-install(1)} \- install package"
    }

    bool pkg-uninstall|uninstall
    {
      "\l{bpkg-pkg-uninstall(1)} \- uninstall package"
    }

    bool pkg-update|update
    {
      "\l{bpkg-pkg-update(1)} \- update package"
    }

    bool pkg-test|test
    {
      "\l{bpkg-pkg-test(1)} \- test package"
    }

    bool pkg-clean|clean
    {
      "\l{bpkg-pkg-clean(1)} \- clean package"
    }

    bool pkg-verify
    {
      "<archive>",
      "\l{bpkg-pkg-verify(1)} \- verify package archive",
      ""
    }

    bool pkg-fetch
    {
      "\l{bpkg-pkg-fetch(1)} \- fetch package archive"
    }

    bool pkg-unpack
    {
      "\l{bpkg-pkg-unpack(1)} \- unpack package archive"
    }

    bool pkg-configure
    {
      "\l{bpkg-pkg-configure(1)} \- configure package"
    }

    bool pkg-disfigure
    {
      "\l{bpkg-pkg-disfigure(1)} \- disfigure package"
    }

    bool pkg-purge
    {
      "\l{bpkg-pkg-purge(1)} \- purge package"
    }

    bool rep-info
    {
      "\l{bpkg-rep-info(1)} \- print repository information"
    }

    bool rep-create
    {
      "[<dir>]",
      "\l{bpkg-rep-create(1)} \- create repository",
      ""
    }
  };

  // Make sure these don't conflict with command names above.
  //
  class topics
  {
    "\h|HELP TOPICS|"

    bool common-options
    {
      "\l{bpkg-common-options(1)} \- details on common options"
    }
  };

  class options: common_options
  {
    bool --help;
    bool --version;
  };

  "\h|EXIT STATUS|

  Non-zero exit status is returned in case of an error.
  "
}