]>
Commit | Line | Data |
---|---|---|
7c673cae FG |
1 | // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- |
2 | // vim: ts=8 sw=2 smarttab | |
3 | ||
4 | #ifndef CEPH_RBD_OPTION_PRINTER_H | |
5 | #define CEPH_RBD_OPTION_PRINTER_H | |
6 | ||
7 | #include "include/int_types.h" | |
8 | #include <string> | |
9 | #include <vector> | |
10 | #include <boost/program_options.hpp> | |
11 | ||
12 | namespace rbd { | |
13 | ||
14 | class OptionPrinter { | |
15 | public: | |
16 | typedef boost::program_options::options_description OptionsDescription; | |
17 | ||
18 | static const std::string POSITIONAL_ARGUMENTS; | |
19 | static const std::string OPTIONAL_ARGUMENTS; | |
20 | ||
21 | static const size_t LINE_WIDTH = 80; | |
22 | static const size_t MIN_NAME_WIDTH = 20; | |
9f95a23c | 23 | static const size_t MAX_DESCRIPTION_OFFSET = 37; |
7c673cae FG |
24 | |
25 | OptionPrinter(const OptionsDescription &positional, | |
26 | const OptionsDescription &optional); | |
27 | ||
28 | void print_short(std::ostream &os, size_t initial_offset); | |
29 | void print_detailed(std::ostream &os); | |
30 | ||
31 | private: | |
32 | const OptionsDescription &m_positional; | |
33 | const OptionsDescription &m_optional; | |
34 | ||
35 | size_t compute_name_width(size_t indent); | |
36 | }; | |
37 | ||
38 | } // namespace rbd | |
39 | ||
40 | #endif // CEPH_RBD_OPTION_PRINTER_H |