From a51e4faad87e0b18a14c4cb6c7b5796ad0467c11 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 18 Jan 2016 12:53:31 +0200 Subject: Stop quoting \c in plain text The recommended approach is to quote manually and only values that can be genuinely confused for being part of the text. For example, '-', '/', etc. --- cli/context.cxx | 10 ---------- cli/options.cli | 16 ++++++++-------- cli/options.cxx | 30 +++++++++++++++--------------- 3 files changed, 23 insertions(+), 33 deletions(-) diff --git a/cli/context.cxx b/cli/context.cxx index 25a88a0..e245dea 100644 --- a/cli/context.cxx +++ b/cli/context.cxx @@ -702,11 +702,6 @@ format_line (output_type ot, string& r, const char* s, size_t n) if (b & itlc) r += "\033[4m"; } - else - { - if (b & code) - r += "'"; - } } break; @@ -830,11 +825,6 @@ format_line (output_type ot, string& r, const char* s, size_t n) if (eb & itlc) r += "\033[4m"; } - else - { - if (b & code) - r += "'"; - } } break; diff --git a/cli/options.cli b/cli/options.cli index 20e1987..26bf834 100644 --- a/cli/options.cli +++ b/cli/options.cli @@ -181,7 +181,7 @@ class options "Use ANSI color escape sequences when printing usage. By \"color\" we really only mean the bold and underline modifiers. Note that Windows console does not recognize ANSI escape sequences and will display - them as garbage. However, if you pipe such output through \c{\b{less}(1)}, + them as garbage. However, if you pipe such output through \cb{less(1)}, it will display them correctly." }; @@ -456,7 +456,7 @@ class options std::string --option-prefix = "-" { "", - "Use instead of the default \cb{-} as an option prefix. Unknown + "Use instead of the default '\cb{-}' as an option prefix. Unknown command line arguments that start with this prefix are treated as unknown options. If you set the option prefix to the empty value, then all the unknown command line arguments will be treated as program arguments." @@ -465,16 +465,16 @@ class options std::string --option-separator = "--" { "", - "Use instead of the default \cb{--} as an optional separator between - options and arguments. All the command line arguments that are parsed - after this separator are treated as program arguments. Set the option - separator to the empty value if you don't want this functionality." + "Use instead of the default '\cb{--}' as an optional separator + between options and arguments. All the command line arguments that are + parsed after this separator are treated as program arguments. Set the + option separator to the empty value if you don't want this functionality." }; bool --include-with-brackets { - "Use angle brackets (<>) instead of quotes (\"\") in the generated - \cb{#include} directives." + "Use angle brackets (\cb{<>}) instead of quotes (\cb{\"\"}) in the + generated \cb{#include} directives." }; std::string --include-prefix diff --git a/cli/options.cxx b/cli/options.cxx index 0be47dc..562a789 100644 --- a/cli/options.cxx +++ b/cli/options.cxx @@ -1336,7 +1336,7 @@ print_usage (::std::ostream& os, ::cli::usage_para p) os << "--version Print version and exit." << ::std::endl; - os << "--include-path|-I Search for bracket-included ('<>') options" << ::std::endl + os << "--include-path|-I Search for bracket-included (<>) options" << ::std::endl << " files." << ::std::endl; os << "--output-dir|-o Write the generated files to instead of the" << ::std::endl @@ -1351,21 +1351,21 @@ print_usage (::std::ostream& os, ::cli::usage_para p) os << "--generate-specifier Generate functions for determining whether the" << ::std::endl << " option was specified on the command line." << ::std::endl; - os << "--generate-parse Generate 'parse()' functions instead of parsing" << ::std::endl + os << "--generate-parse Generate parse() functions instead of parsing" << ::std::endl << " constructors." << ::std::endl; os << "--generate-description Generate the option description list that can be" << ::std::endl << " examined at runtime." << ::std::endl; - os << "--generate-file-scanner Generate the 'argv_file_scanner' implementation." << ::std::endl; + os << "--generate-file-scanner Generate the argv_file_scanner implementation." << ::std::endl; os << "--suppress-inline Generate all functions non-inline." << ::std::endl; os << "--cli-namespace Generate the CLI support types in the " << ::std::endl - << " namespace ('cli' by default)." << ::std::endl; + << " namespace (cli by default)." << ::std::endl; os << "--ostream-type Output stream type instead of the default" << ::std::endl - << " 'std::ostream' that should be used to print usage" << ::std::endl + << " std::ostream that should be used to print usage" << ::std::endl << " and exception information." << ::std::endl; os << "--generate-cxx Generate C++ code." << ::std::endl; @@ -1388,8 +1388,8 @@ print_usage (::std::ostream& os, ::cli::usage_para p) os << "--long-usage If no short documentation string is provided, use" << ::std::endl << " the complete long documentation string in usage." << ::std::endl; - os << "--short-usage If specified together with '--long-usage'," << ::std::endl - << " generate both short and long usage versions." << ::std::endl; + os << "--short-usage If specified together with --long-usage, generate" << ::std::endl + << " both short and long usage versions." << ::std::endl; os << "--page-usage Generate the combined usage printing code for the" << ::std::endl << " entire page." << ::std::endl; @@ -1493,22 +1493,22 @@ print_usage (::std::ostream& os, ::cli::usage_para p) os << "--output-suffix Add at the end of the generated output" << ::std::endl << " file name(s)." << ::std::endl; - os << "--hxx-suffix Use instead of the default '.hxx' to" << ::std::endl + os << "--hxx-suffix Use instead of the default .hxx to" << ::std::endl << " construct the name of the generated header file." << ::std::endl; - os << "--ixx-suffix Use instead of the default '.ixx' to" << ::std::endl + os << "--ixx-suffix Use instead of the default .ixx to" << ::std::endl << " construct the name of the generated inline file." << ::std::endl; - os << "--cxx-suffix Use instead of the default '.cxx' to" << ::std::endl + os << "--cxx-suffix Use instead of the default .cxx to" << ::std::endl << " construct the name of the generated source file." << ::std::endl; - os << "--man-suffix Use instead of the default '.1' to" << ::std::endl + os << "--man-suffix Use instead of the default .1 to" << ::std::endl << " construct the name of the generated man page file." << ::std::endl; - os << "--html-suffix Use instead of the default '.html' to" << ::std::endl + os << "--html-suffix Use instead of the default .html to" << ::std::endl << " construct the name of the generated HTML file." << ::std::endl; - os << "--txt-suffix Use instead of the default '.txt' to" << ::std::endl + os << "--txt-suffix Use instead of the default .txt to" << ::std::endl << " construct the name of the generated text file." << ::std::endl; os << "--option-prefix Use instead of the default '-' as an" << ::std::endl @@ -1518,9 +1518,9 @@ print_usage (::std::ostream& os, ::cli::usage_para p) << " optional separator between options and arguments." << ::std::endl; os << "--include-with-brackets Use angle brackets (<>) instead of quotes (\"\") in" << ::std::endl - << " the generated '#include' directives." << ::std::endl; + << " the generated #include directives." << ::std::endl; - os << "--include-prefix Add to the generated '#include' directive" << ::std::endl + os << "--include-prefix Add to the generated #include directive" << ::std::endl << " paths." << ::std::endl; os << "--guard-prefix Add to the generated header inclusion" << ::std::endl -- cgit v1.1