| Index
» Projects
» libcfg+
» Bug list
» Bug #88 |
 |
|
Viewing Bug Advanced Details |
[ Jump to Bugnotes ]
[ Bug History ]
[ Print ]
|
|
ID |
Category |
Severity |
Reproducibility |
Date Submitted |
Last Update |
|
0000088 |
library core |
feature |
always |
2003-04-24 16:28 |
2003-04-25 00:38 |
|
|
|
Reporter |
rajo |
View Status |
public |
|
|
Assigned To |
rajo |
|
Priority |
normal |
Resolution |
not a bug |
Platform |
|
|
Status |
resolved |
Duplicate ID |
|
OS |
|
|
Projection |
none |
|
Version |
|
|
ETA |
none |
|
Product Version |
|
|
|
Product Build |
|
|
|
Votes |
1 |
|
|
|
Summary |
can't mix multiple CFG_LINE_LONG_OPTION_PREFIXes |
|
Description |
Considering this part of code:
<pre>
struct cfg_option options[] = {
{ "help", 'h', NULL, CFG_BOOL, (void *) &help, 0 },
CFG_END_OF_LIST
}
cfg_clear_property(con, CFG_LINE_LONG_OPTION_PREFIX);
cfg_add_properties(con, CFG_LINE_LONG_OPTION_PREFIX, "--", "@@", CFG_EOT);
</pre>
In other words:I will support "./program --help" and "./program @@help" in my program. It seems to be impossible use both prefixes at one time.
|
|
Steps To Reproduce |
|
|
Additional Information / Solution |
I will use this behaviour in my program (Monte Carlo simulation of symetric charge-exchange collision -- diploma thesis). I will support:
<pre>
./hotGas N=1e6 lambda=3e-7 time=10.0 help
./hotGas N=1e6 lambda=3e-7 time=10.0 --help
./hotGas help
./hotGas --help
</pre>
Source code of program is attached. |
|
Attached Files |
hotGas.c (22,986 bytes) 2003-04-24 16:28 |
|
|
|
Bug Notes |
rajo
2003-04-25 00:38
|
There was bug only in documentation. And also in compiled program.
The proper usage of libcfg+ is:
struct cfg_option options[] = {
{ "help", 'h', NULL, CFG_BOOL, (void *) &help, 0 },
{ "Nx", 'X', NULL, CFG_LONG, (void *) &Nx, 0 },
CFG_END_OF_LIST
};
/* Creating context */
con = cfg_get_context(options);
if (con == NULL) {
puts("Not enough memory");
return 1;
}
cfg_clear_property(con, CFG_LINE_LONG_OPTION_PREFIX);
cfg_add_properties_type(con, CFG_LINE_LONG_OPTION_PREFIX, "--", "", NULL);
... |
|
|
|
|