1 // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
2 // vim: ts=8 sw=2 smarttab
4 #ifndef CEPH_RBD_OPTION_PRINTER_H
5 #define CEPH_RBD_OPTION_PRINTER_H
7 #include "include/int_types.h"
10 #include <boost/algorithm/string.hpp>
11 #include <boost/program_options.hpp>
17 typedef boost::program_options::options_description OptionsDescription
;
19 static const std::string POSITIONAL_ARGUMENTS
;
20 static const std::string OPTIONAL_ARGUMENTS
;
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;
26 OptionPrinter(const OptionsDescription
&positional
,
27 const OptionsDescription
&optional
);
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
);
35 const OptionsDescription
&m_positional
;
36 const OptionsDescription
&m_optional
;
38 size_t compute_name_width(size_t indent
);
43 #endif // CEPH_RBD_OPTION_PRINTER_H