blob: df4a28660a5a389e141d42df2c5f03688cb651a8 (
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
|
// file : bpkg/help.cxx -*- C++ -*-
// copyright : Copyright (c) 2014-2015 Code Synthesis Ltd
// license : MIT; see accompanying LICENSE file
#include <bpkg/help>
#include <iostream>
#include <bpkg/types>
#include <bpkg/utility>
#include <bpkg/diagnostics>
#include <bpkg/bpkg-options>
using namespace std;
namespace bpkg
{
static void
help ()
{
print_bpkg_usage (cout);
}
int
help (const help_options&, const string& t, usage_function* usage)
{
ostream& o (cout);
if (usage != nullptr) // Command.
usage (o, cli::usage_para::none);
else if (t.empty ()) // General help.
help ();
else if (t == "common-options") // Help topics.
{
print_bpkg_common_options_long_usage (cout);
}
else
fail << "unknown bpkg command/help topic '" << t << "'" <<
info << "run 'bpkg help' for more information";
return 0;
}
}
|