]> git.proxmox.com Git - ceph.git/blob - ceph/src/tools/rbd/OptionPrinter.h
bump version to 18.2.2-pve1
[ceph.git] / ceph / src / tools / rbd / OptionPrinter.h
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/algorithm/string.hpp>
11 #include <boost/program_options.hpp>
12
13 namespace rbd {
14
15 class OptionPrinter {
16 public:
17 typedef boost::program_options::options_description OptionsDescription;
18
19 static const std::string POSITIONAL_ARGUMENTS;
20 static const std::string OPTIONAL_ARGUMENTS;
21
22 static const size_t LINE_WIDTH = 80;
23 static const size_t MIN_NAME_WIDTH = 20;
24 static const size_t MAX_DESCRIPTION_OFFSET = 37;
25
26 OptionPrinter(const OptionsDescription &positional,
27 const OptionsDescription &optional);
28
29 void print_short(std::ostream &os, size_t initial_offset);
30 void print_detailed(std::ostream &os);
31 static void print_optional(const OptionsDescription &global_opts,
32 size_t &name_width, std::ostream &os);
33
34 private:
35 const OptionsDescription &m_positional;
36 const OptionsDescription &m_optional;
37
38 size_t compute_name_width(size_t indent);
39 };
40
41 } // namespace rbd
42
43 #endif // CEPH_RBD_OPTION_PRINTER_H