• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1
2Say that variables_map is actually derived from std::map.
3
4Make parse_config_file("foo.cfg", desc) work.
5
6Document handling of positional options which depends on precedding options.
7I.e scanning the parsed options and creating new variables_map when we see
8a positional option. (Email from Tony).
9
10> My instinctive reaction is to provide both via an options argument to
11> split_command_line (a name that would now be more appropriate). But I
12> haven't devoted much time to thinking this through, so I may be wrong. :-)
13>
14> In any event, the tokenization isn't much fun. I'd expect the library to
15> provide a convenient mechanism for parsing a response file.
16
17
18> Similarly, is there some easy to use hook for customizing the "arg" to
19> indicate the type of the data (similar to how the textual representation
20> of the default argument can be changed, e.g.
21> value<Infile>(&forests_file)->default_value(default_in,"STDIN"), so that
22> I could get something like: "-f filename (=STDIN)   :" instead of "-f
23> arg (=STDIN)  :"?
24
25> A minor nit pick, with option groups (chained options_description), the
26> colons for the same group align but not across groups.
27
28
29There's another possibility:
30
31   value<type>(&variable, "filename")->......
32
33something like that was in the pre-review version, with the difference that the value name was also used to specify flags, e.g "filename?" would mean the value is optional.
34
35
36Should we also store the name specified on the command line in basic_option,
37so that validation_error can mention the *specified* option name?
38
39
40The config file is a bit different from command line. E.g. 'bool_switch' can't
41be specified in the config file. Further, it's not possible to specify a list
42of values in config file. For example, you can't write
43
44   include=a,b,c,d
45
46(or some other separator). You need:
47
48   include=a
49   ...
50   include=d
51
52
53
54> I often find it beneficial to start a log file, by tracing all options
55> in effect. Thus, it would be nice if one could iterate over all values
56> in a variable_map and get a string representation of all values. Perhaps
57> as an iterator range to the original string that was parsed into the
58> value in the first place. Using as<string> delegates to boost::any and
59> only succeeds if the value is indeed a string (a design decision I can
60> only applaud, btw), so I'm out of luck there.
61
62
63
64
65UML diagram?
66
67src/cmdline.cpp: function strncmp_nocase():
68>     maybe it can be replaced by something from string_algorithms
69>     library. AFAIK the library should be in 1.32.
70
71> 24. the documentation may contain info what source files are needed
72>     for which feature or whether they need to be included always all.
73
74The program_options.reference.html may contain one-liner
75   overview for every header and every class/typedef/function
76   listed here - just for quick browsing and overview.
77
78
79> > > 5. Maybe more overcommented code examples can be added into
80> > >    docs, each exploring single feature of library.
81> > >
82> > >    Some people learn mostly from such examples.
83> > >
84> > >    Later note: definitely would be useful, IMO.
85> >
86> > Maybe. Do you have specific ideas what the examples can be about?
87>
88> One tiny example concentrating on one feature as short/long options,
89> multiple sources, hidden options, positional options, INI handling etc.
90> Something what user can skim over and cut/paste into app.
91
92
93> I would prefer that all occurrences of ASCII be capitalized.  It is the
94> abbreviation of the name of the Standard.  You may show it in lower case,
95> though, to distinguish "char strings in local 8-bit encoding" from the
96> Standard but it may confuse some readers.  I can't think of a good
97> alternative right now.
98
99> [By the way, "positional options" _desperately_ needs an entry in the
100> glossary. It's the most mystifying term in the library.]
101
102> If not already stated, you should note that all options must appear in the
103> options description layer (or class or object).  No options may make their
104> first appearance in the runtime configuration file, for instance.  The
105> library doesn't like surprises.  (I bring this up because other
106> initialization libraries allow an option to be declared in the
107> configuration file alone.  The file reader stores the option and parses it
108> to determine its type, for example, Boolean, double, integer or string.)
109
110-----------
111> "In the simplest case, the name is explicitly specified, which allows the
112> program to decide if such an option is known."
113>
114> or
115>
116> "In the simplest case, the name is explicitly specified and the program
117> decides that the option is known."
118> (This paragraph is a bit hard to read.  Maybe when I understand the library
119> better I can suggest some wording which flows more smoothly.)
120
121Maybe some explanation can help. Most of the time, input source contains both
122the name of option and the value, for example, --foo=10. In this case, we
123just lookup the option name, decide we know this option, and process it.
124
125In one specific case -- positional command line options, we don't have
126explicit name. For example:
127
128   my_prog 1 2 3
129
130so more complex logic is necessary.
131
132
133> Rather than clutter up this list it might be better for the word "sources"
134> to be a link to another part of the document which lists the sources and
135> the order of precedence.
136
137Style of 'screen' in docs.
138
139> Perhaps you should include some sample output to show correct and incorrect
140> locale support or include a link to somewhere else in Boost where the
141> reader can find more information.  I wouldn't know a Unicode if it came up
142> and bit me on the ankle.
143
144
145> "Common cases are when the value is explicitly specified by the user, and
146> when the value cannot be specified by the user, but the presense of the
147> option implies some value (for example, <code>true</code>). So, the parser
148> checks that the value is specified when needed and not specified when not
149> needed, and returns new (name, value) pair."
150>
151> This wording is quite stiff and I can't decipher it, especially the "not
152> specified when not needed" phrase.  Can you rewrite this?
153
154> While I'm thinking about it, can you add the "Last revised..." line at the
155> bottom of each HTML page as it is on program_options.html or it that
156> governed by an xsl file?
157
158> If it doesn't already exist, there should be something in the tutorial to
159> explicitly define the steps required prior to the use of a configuration
160> variable as:
161> 1. declaration
162> 2. addition or composition
163> 3. storage or insertion
164> 4. notification.
165
166
167> I think a few lines should be added to aid the library user with the test
168> programs.  You could place them here in howto.xml or elsewhere or in a new
169> section entirely.  Users will want to know if their compiler is known to
170> work with the library and should be directed to the Boost Compiler Status
171> Tables page (\status\compiler_status.html or similar) or directly to the
172> Compiler Status Summary (http://boost.sourceforge.net/regression-logs/).
173
174> Many users will want to run the test programs on their own computer.  Your
175> documentation should answer these questions:
176> Which libraries must be linked to build the programs? (Dynamic? Static?)
177> Are there any other special considerations or any compiler switches to be
178> set? For those without a full Boost package, which other Boost libraries
179> are "included" by the test programs and, therefore, must be available?
180
181Basically, it's assumed that test programs with be run with Boost.Build.
182Maybe it's worth noting that if a user wants to compiler them himself,
183he should link the program_options library.
184
185> If you decide to make a separate section to describe the implementation of
186> the test programs, you might move the "test_convert" paragraphs starting at
187> line 379 of howto.xml there and put a referring link in its place.
188
189> I thought there was a bit of correspondence on one of the Boost mailing
190> lists concerning the inability of program_options to show the stored
191> variables 'en masse' but I can't find it now.  You should include that in
192> the documentation. Most users will be searching for a method to verify that
193> command line and configuration file values were actually stored in place of
194> the default values, for instance.  You could put in a line or two stating
195> that there is no one function which will send the entire database to a file
196> for later review.  (I think it had something to do with the fact that
197> program_options doesn't "know" the type of each option.)  I think it will
198> acquire the status of a Frequently-Asked Question.)
199
200
201> > Agreed. Though it's no FAQ section yet.... maybe, I can add this to howto
202>
203> section, though a question without full solution is not good.
204>
205> For the time being, those who want to know if such a display function
206> exists will have their question answered and the reason for it.  I suppose
207> that the library user could insert a series of statements in his program
208> immediately after the "notify" function which would write each known option
209> to a file for later examination.  Some people may use a number of "assert"
210> statements instead. They would only come into play in the debug mode.
211
212More visibility for bool_switch.
213
214
215> BTW: I thought of one other comment. One of the things I missed a little
216> in the documentation is a description of the config file format, as well
217> as what can be achieved with the po::command_line_style::style_t enum. I
218> think most users will need this information sooner or later. A few
219> examples would be fine... But then again time is such a precious thing
220
221> Does the library supports sections in config files
222
223> What about the combination of (if some user-settable switch is thrown,
224> but not by default):
225>
226> * allowing unknown options -- these are considered positional parameters
227> * rearranging the argument list such that all positional parameters
228> are moved to the end
229>
230> This way:
231>
232> program --unknown 42 --known-flag --known-arg value
233>
234> is handled as if it were (in standard UNIX command-line-ese):
235>
236> program --known-flag --known-arg value -- --unknown 42
237
238
239