From 4287ba32b7852804fd11f4fbe67f23772aad3b26 Mon Sep 17 00:00:00 2001 From: ivanpanch Date: Thu, 28 Aug 2025 00:08:03 +0200 Subject: [PATCH] docs: correct spelling and grammar --- doc/acknowledgements.xml | 4 ++-- doc/design.xml | 6 +++--- doc/howto.xml | 10 +++++----- doc/overview.xml | 14 +++++++------- doc/program_options.xml | 2 +- include/boost/program_options/cmdline.hpp | 4 ++-- include/boost/program_options/eof_iterator.hpp | 4 ++-- include/boost/program_options/errors.hpp | 8 ++++---- .../boost/program_options/options_description.hpp | 2 +- include/boost/program_options/parsers.hpp | 8 ++++---- .../boost/program_options/positional_options.hpp | 2 +- include/boost/program_options/value_semantic.hpp | 14 +++++++------- include/boost/program_options/variables_map.hpp | 4 ++-- 13 files changed, 41 insertions(+), 41 deletions(-) diff --git a/doc/acknowledgements.xml b/doc/acknowledgements.xml index e72e33c..1fe0bad 100644 --- a/doc/acknowledgements.xml +++ b/doc/acknowledgements.xml @@ -8,7 +8,7 @@
Acknowledgements - I'm very gratefull to all the people who helped with the development, + I'm very grateful to all the people who helped with the development, by discussion, fixes, and as users. It was pleasant to see all that involvement, which made the library much better than it would be otherwise. @@ -25,7 +25,7 @@ The formal review lead to numerous comments and enhancements. Pavol Droba helped with the option description semantic. Gennadiy Rozental has criticised many aspects of the library which caused various simplifications. - Pavel Vozenilek did carefull review of the implementation. A number of + Pavel Vozenilek did careful review of the implementation. A number of comments were made by: David Abrahams diff --git a/doc/design.xml b/doc/design.xml index 0881500..85e3fe8 100644 --- a/doc/design.xml +++ b/doc/design.xml @@ -74,7 +74,7 @@ of the library -- ascii and Unicode. - Another important point is that ascii strings are passed though + Another important point is that ascii strings are passed through without modification. In other words, it's not possible to just convert ascii to Unicode and process the Unicode further. The problem is that the default conversion mechanism -- the codecvt facet -- might @@ -85,7 +85,7 @@ don't support Unicode option names. Unicode support is hard and requires a Boost-wide solution. Even comparing two arbitrary Unicode strings is non-trivial. Finally, using Unicode in option names is - related to internationalization, which has it's own + related to internationalization, which has its own complexities. E.g. if option names depend on current locale, then all program parts and other parts which use the name must be internationalized too. @@ -210,4 +210,4 @@ sgml-parent-document: ("program_options.xml" "section") sgml-set-face: t End: ---> \ No newline at end of file +--> diff --git a/doc/howto.xml b/doc/howto.xml index 0841c9f..0e3b6d6 100644 --- a/doc/howto.xml +++ b/doc/howto.xml @@ -23,7 +23,7 @@ options groups/hidden options Non-conventional Syntax Sometimes, standard command line syntaxes are not enough. For - example, the gcc compiler has "-frtti" and -fno-rtti" options, and this + example, the gcc compiler has "-frtti" and "-fno-rtti" options, and this syntax is not directly supported. @@ -66,7 +66,7 @@ store(command_line_parser(ac, av).options(desc).extra_parser(reg_foo) response files - Some operating system have very low limits of the command line + Some operating systems have very low limits of the command line length. The common way to work around those limitations is using response files. A response file is just a configuration file which uses the same syntax as the command line. If @@ -304,7 +304,7 @@ void validate(boost::any& v, for the value, and in this case is either empty or contains an instance of the magic_number class. The second is the list of strings found in the next occurrence of the option. The remaining two parameters - are needed to workaround the lack of partial template specialization and + are needed to work around the lack of partial template specialization and partial function template ordering on some compilers. @@ -346,7 +346,7 @@ void validate(boost::any& v, some Unicode-aware options. They are different from ordinary options in that they accept wstring input, and process it using wide character streams. Creating an Unicode-aware option - is easy: just use the the wvalue function instead of the + is easy: just use the wvalue function instead of the regular value. @@ -379,7 +379,7 @@ locale::global(locale("")); implementation, though. The quick test involves three steps: - Go the the "test" directory and build the "test_convert" binary. + Go to the "test" directory and build the "test_convert" binary. Set some non-ascii locale in the environment. On Linux, one can diff --git a/doc/overview.xml b/doc/overview.xml index 52fe9b9..677c7ae 100644 --- a/doc/overview.xml +++ b/doc/overview.xml @@ -50,7 +50,7 @@ provides a class which stores all option values and that class can be freely passed around your program to modules which need access to the options. All the other components can be used only in the place where - the actual parsing is the done. However, it might also make sense for the + the actual parsing is done. However, it might also make sense for the individual program modules to describe their options and pass them to the main module, which will merge all options. Of course, this is only important when the number of options is large and declaring them in one @@ -208,7 +208,7 @@ desc.add_options() The description string has one or more paragraphs, separated by the newline character ('\n'). When an option is output, the library will compute the indentation for options's description. Each of the - paragraph is output as a separate line with that intentation. If + paragraph is output as a separate line with that indentation. If a paragraph does not fit on one line it is spanned over multiple lines (which will have the same indentation). @@ -538,7 +538,7 @@ desc.add_options() The environment variables can be parsed with the - &parse_environment; function. The function have several overloaded + &parse_environment; function. The function has several overloaded versions. The first parameter is always an &options_description; instance, and the second specifies what variables must be processed, and what option names must correspond to it. To describe the second @@ -546,13 +546,13 @@ desc.add_options() variables. If you have an option that should be specified via environment - variable, you need make up the variable's name. To avoid name clashes, + variable, you need to make up the variable's name. To avoid name clashes, we suggest that you use a sufficiently unique prefix for environment variables. Also, while option names are most likely in lower case, environment variables conventionally use upper case. So, for an option name proxy the environment variable might be called BOOST_PROXY. During parsing, we need to perform reverse - conversion of the names. This is accomplished by passing the choosen + conversion of the names. This is accomplished by passing the chosen prefix as the second parameter of the &parse_environment; function. Say, if you pass BOOST_ as the prefix, and there are two variables, CVSROOT and BOOST_PROXY, the @@ -588,7 +588,7 @@ desc.add_options() representations that are available in C++ literals are not supported by lexical_cast, and thus will not work with program_options. - Booleans a special in that there are multiple ways to come at them. + Booleans are special in that there are multiple ways to come at them. Similar to another value type, it can be specified as ("my-option", value<bool>()), and then set as: @@ -648,7 +648,7 @@ example --other-switch &parse_command_line; - parses command line (simpified interface) + parses command line (simplified interface) diff --git a/doc/program_options.xml b/doc/program_options.xml index cd879f7..c945568 100644 --- a/doc/program_options.xml +++ b/doc/program_options.xml @@ -70,7 +70,7 @@ - Now let's see some examples of the library usage in the . diff --git a/include/boost/program_options/cmdline.hpp b/include/boost/program_options/cmdline.hpp index 8705e60..8b57819 100644 --- a/include/boost/program_options/cmdline.hpp +++ b/include/boost/program_options/cmdline.hpp @@ -9,7 +9,7 @@ namespace boost { namespace program_options { namespace command_line_style { /** Various possible styles of options. - There are "long" options, which start with "--" and "short", + There are "long" options, which start with "--", and "short", which start with either "-" or "/". Both kinds can be allowed or disallowed, see allow_long and allow_short. The allowed character for short options is also configurable. @@ -51,7 +51,7 @@ namespace boost { namespace program_options { namespace command_line_style { /** Allow to merge several short options together, so that "-s -k" become "-sk". All of the options but last should accept no parameter. For example, if - "-s" accept a parameter, then "k" will be taken as + "-s" accepts a parameter, then "k" will be taken as parameter, not another short option. Dos-style short options cannot be sticky. */ diff --git a/include/boost/program_options/eof_iterator.hpp b/include/boost/program_options/eof_iterator.hpp index 5e53df5..c95d27f 100644 --- a/include/boost/program_options/eof_iterator.hpp +++ b/include/boost/program_options/eof_iterator.hpp @@ -11,12 +11,12 @@ namespace boost { /** The 'eof_iterator' class is useful for constructing forward iterators - in cases where iterator extract data from some source and it's easy + in cases where the iterator extracts data from some source and it's easy to detect 'eof' \-- i.e. the situation where there's no data. One apparent example is reading lines from a file. Implementing such iterators using 'iterator_facade' directly would - require to create class with three core operation, a couple of + require to create class with three core operations, a couple of constructors. When using 'eof_iterator', the derived class should define only one method to get new value, plus a couple of constructors. diff --git a/include/boost/program_options/errors.hpp b/include/boost/program_options/errors.hpp index 56674bf..5b4d1d3 100644 --- a/include/boost/program_options/errors.hpp +++ b/include/boost/program_options/errors.hpp @@ -51,7 +51,7 @@ namespace boost { namespace program_options { {} }; - /** Class thrown when there are programming error related to style */ + /** Class thrown when there are programming errors related to style */ class BOOST_PROGRAM_OPTIONS_DECL BOOST_SYMBOL_VISIBLE invalid_command_line_style : public error { public: invalid_command_line_style(const std::string& msg) @@ -83,7 +83,7 @@ namespace boost { namespace program_options { * Options are displayed in "canonical" form * This is the most unambiguous form of the * *parsed* option name and would correspond to - * option_description::format_name() + * option_description::format_name(), * i.e. what is shown by print_usage() * * The "canonical" form depends on whether the option is @@ -243,7 +243,7 @@ namespace boost { namespace program_options { * It makes no sense to have an option name, when we can't match an option to the * parameter * - * Having this a part of the error_with_option_name hierachy makes error handling + * Having this as part of the error_with_option_name hierarchy makes error handling * a lot easier, even if the name indicates some sort of conceptual dissonance! * * */ @@ -275,7 +275,7 @@ namespace boost { namespace program_options { - /** Class thrown when there's ambiguity amoung several possible options. */ + /** Class thrown when there's ambiguity among several possible options. */ class BOOST_PROGRAM_OPTIONS_DECL BOOST_SYMBOL_VISIBLE ambiguous_option : public error_with_no_option_name { public: ambiguous_option(const std::vector& xalternatives) diff --git a/include/boost/program_options/options_description.hpp b/include/boost/program_options/options_description.hpp index 90d913d..da2c4bb 100644 --- a/include/boost/program_options/options_description.hpp +++ b/include/boost/program_options/options_description.hpp @@ -105,7 +105,7 @@ namespace program_options { /** Returns the canonical name for the option description to enable the user to - recognised a matching option. + recognise a matching option. 1) For short options ('-', '/'), returns the short name prefixed. 2) For long options ('--' / '-') returns the first long name prefixed 3) All other cases, returns the first long name (if present) or the short diff --git a/include/boost/program_options/parsers.hpp b/include/boost/program_options/parsers.hpp index 230af29..c86b537 100644 --- a/include/boost/program_options/parsers.hpp +++ b/include/boost/program_options/parsers.hpp @@ -150,7 +150,7 @@ namespace boost { namespace program_options { instance of basic_option will be added to result, with 'unrecognized' field set to 'true'. It's possible to collect all unrecognized options with the 'collect_unrecognized' - funciton. + function. */ basic_command_line_parser& allow_unregistered(); @@ -214,7 +214,7 @@ namespace boost { namespace program_options { /** Collects the original tokens for all named options with 'unregistered' flag set. If 'mode' is 'include_positional' also collects all positional options. - Returns the vector of origianl tokens for all collected + Returns the vector of original tokens for all collected options. */ template @@ -254,8 +254,8 @@ namespace boost { namespace program_options { /** Splits a given string to a collection of single strings which can be passed to command_line_parser. The second parameter is - used to specify a collection of possible seperator chars used - for splitting. The seperator is defaulted to space " ". + used to specify a collection of possible separator chars used + for splitting. The separator is defaulted to space " ". Splitting is done in a unix style way, with respect to quotes '"' and escape characters '\' */ diff --git a/include/boost/program_options/positional_options.hpp b/include/boost/program_options/positional_options.hpp index ac2a312..c19c925 100644 --- a/include/boost/program_options/positional_options.hpp +++ b/include/boost/program_options/positional_options.hpp @@ -37,7 +37,7 @@ namespace boost { namespace program_options { public: positional_options_description(); - /** Species that up to 'max_count' next positional options + /** Specifies that up to 'max_count' next positional options should be given the 'name'. The value of '-1' means 'unlimited'. No calls to 'add' can be made after call with 'max_value' equal to '-1'. diff --git a/include/boost/program_options/value_semantic.hpp b/include/boost/program_options/value_semantic.hpp index ac9dbc6..8265749 100644 --- a/include/boost/program_options/value_semantic.hpp +++ b/include/boost/program_options/value_semantic.hpp @@ -51,7 +51,7 @@ namespace boost { namespace program_options { /** Parses a group of tokens that specify a value of option. Stores the result in 'value_store', using whatever representation - is desired. May be be called several times if value of the same + is desired. May be called several times if value of the same option is specified more than once. */ virtual void parse(boost::any& value_store, @@ -71,7 +71,7 @@ namespace boost { namespace program_options { virtual ~value_semantic() {} }; - /** Helper class which perform necessary character conversions in the + /** Helper class which performs necessary character conversions in the 'parse' method and forwards the data further. */ template @@ -140,7 +140,7 @@ namespace boost { namespace program_options { bool is_required() const { return false; } /** If 'value_store' is already initialized, or new_tokens - has more than one elements, throws. Otherwise, assigns + has more than one element, throws. Otherwise, assigns the first string from 'new_tokens' to 'value_store', without any modifications. */ @@ -157,7 +157,7 @@ namespace boost { namespace program_options { }; #ifndef BOOST_NO_RTTI - /** Base class for all option that have a fixed type, and are + /** Base class for all options that have a fixed type, and are willing to announce this type to the outside world. Any 'value_semantics' for which you want to find out the type can be dynamic_cast-ed to typed_value_base. If conversion @@ -218,7 +218,7 @@ namespace boost { namespace program_options { /** Specifies an implicit value, which will be used if the option is given, but without an adjacent value. - Using this implies that an explicit value is optional, + Using this implies that an explicit value is optional. */ typed_value* implicit_value(const T &v) { @@ -228,7 +228,7 @@ namespace boost { namespace program_options { return this; } - /** Specifies the name used to to the value in help message. */ + /** Specifies the name used for the value in the help message. */ typed_value* value_name(const std::string& name) { m_value_name = name; @@ -278,7 +278,7 @@ namespace boost { namespace program_options { } /** Specifies that no tokens may be provided as the value of - this option, which means that only presense of the option + this option, which means that only presence of the option is significant. For such option to be useful, either the 'validate' function should be specialized, or the 'implicit_value' method should be also used. In most diff --git a/include/boost/program_options/variables_map.hpp b/include/boost/program_options/variables_map.hpp index 362dedf..a21adab 100644 --- a/include/boost/program_options/variables_map.hpp +++ b/include/boost/program_options/variables_map.hpp @@ -62,7 +62,7 @@ namespace boost { namespace program_options { : v(xv), m_defaulted(xdefaulted) {} - /** If stored value if of type T, returns that value. Otherwise, + /** If stored value is of type T, returns that value. Otherwise, throws boost::bad_any_cast exception. */ template const T& as() const { @@ -138,7 +138,7 @@ namespace boost { namespace program_options { const abstract_variables_map* m_next; }; - /** Concrete variables map which store variables in real map. + /** Concrete variables map which stores variables in real map. This class is derived from std::map, so you can use all map operators to examine its content.