diff options
author | 2007-11-19 11:44:21 +0000 | |
---|---|---|
committer | 2007-11-19 11:44:21 +0000 | |
commit | 7d73417eb461c69f78577cffc4034ff837c70948 (patch) | |
tree | c72f702a9031729f29fe66039b3e7305448eed20 /paludis/args/man.cc | |
parent | 6e3e3cfcdcbae9abe74e741f36ce6937f732bf05 (diff) | |
download | paludis-7d73417eb461c69f78577cffc4034ff837c70948.tar.gz paludis-7d73417eb461c69f78577cffc4034ff837c70948.tar.xz |
Support for --no- for various switch args
Diffstat (limited to 'paludis/args/man.cc')
-rw-r--r-- | paludis/args/man.cc | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/paludis/args/man.cc b/paludis/args/man.cc index c71ccb398..218333312 100644 --- a/paludis/args/man.cc +++ b/paludis/args/man.cc @@ -118,7 +118,8 @@ paludis::args::generate_doc(DocWriter & dw, const ArgsHandler * const h) for (paludis::args::ArgsGroup::ConstIterator b((*a)->begin()), b_end((*a)->end()) ; b != b_end ; ++b) { - dw.arg_group_item((*b)->short_name(), (*b)->long_name(), (*b)->description()); + dw.arg_group_item((*b)->short_name(), (*b)->long_name(), + (*b)->can_be_negated() ? "no-" + (*b)->long_name() : "", (*b)->description()); ExtraText t(dw); (*b)->accept(t); @@ -206,12 +207,14 @@ HtmlWriter::start_arg_group(const std::string & name, const std::string & descri void HtmlWriter::arg_group_item(const char & short_name, const std::string & long_name, - const std::string & description) + const std::string & negated_long_name, const std::string & description) { _os << "<dt>"; if (short_name) - _os << "-" << short_name << ", "; - _os << "--" << long_name << "</dt>" << endl; + _os << "-" << short_name << ", " << "--" << long_name; + if (! negated_long_name.empty()) + _os << ", " << "--" << negated_long_name; + _os << "</dt>" << endl; _os << "<dd>" << description << endl; } @@ -374,13 +377,16 @@ ManWriter::start_arg_group(const std::string & name, const std::string & descrip void ManWriter::arg_group_item(const char & short_name, const std::string & long_name, - const std::string & description) + const std::string & negated_long_name, const std::string & description) { _os << ".TP" << endl; _os << ".B \""; if (short_name) _os << "\\-" << short_name << " , "; - _os << "\\-\\-" << long_name << "\"" << endl; + _os << "\\-\\-" << long_name; + if (! negated_long_name.empty()) + _os << " (\\-\\-" << negated_long_name << ")\""; + _os << endl; _os << description << endl; } |