Added write_hdr_format and write_xact_format, which are used by the
"output" command.
This commit is contained in:
parent
9361c7c2e4
commit
64461f0d95
2 changed files with 16 additions and 2 deletions
16
config.cc
16
config.cc
|
|
@ -35,6 +35,8 @@ config_t::config_t()
|
||||||
plot_amount_format = "%D %(St)\n";
|
plot_amount_format = "%D %(St)\n";
|
||||||
plot_total_format = "%D %(ST)\n";
|
plot_total_format = "%D %(ST)\n";
|
||||||
print_format = "\n%D %X%C%P\n %-34A %12o%n\n%/ %-34A %12o%n\n";
|
print_format = "\n%D %X%C%P\n %-34A %12o%n\n%/ %-34A %12o%n\n";
|
||||||
|
write_hdr_format = "%D %X%C%P\n";
|
||||||
|
write_xact_format = " %-34A %12o%n\n";
|
||||||
equity_format = "\n%D %X%C%P\n%/ %-34A %12t\n";
|
equity_format = "\n%D %X%C%P\n%/ %-34A %12t\n";
|
||||||
#ifndef USE_BOOST_PYTHON
|
#ifndef USE_BOOST_PYTHON
|
||||||
prices_format = "%[%Y/%m/%d %H:%M:%S %Z] %-10A %12t %12T\n";
|
prices_format = "%[%Y/%m/%d %H:%M:%S %Z] %-10A %12t %12T\n";
|
||||||
|
|
@ -147,7 +149,7 @@ void config_t::process_options(const std::string& command,
|
||||||
{
|
{
|
||||||
// Configure some other options depending on report type
|
// Configure some other options depending on report type
|
||||||
|
|
||||||
if (command == "p" || command == "e") {
|
if (command == "p" || command == "e" || command == "w") {
|
||||||
show_related =
|
show_related =
|
||||||
show_all_related = true;
|
show_all_related = true;
|
||||||
}
|
}
|
||||||
|
|
@ -165,7 +167,7 @@ void config_t::process_options(const std::string& command,
|
||||||
|
|
||||||
// Process remaining command-line arguments
|
// Process remaining command-line arguments
|
||||||
|
|
||||||
if (command != "e") {
|
if (command != "e" && command != "w") {
|
||||||
// Treat the remaining command-line arguments as regular
|
// Treat the remaining command-line arguments as regular
|
||||||
// expressions, used for refining report results.
|
// expressions, used for refining report results.
|
||||||
|
|
||||||
|
|
@ -691,6 +693,14 @@ OPT_BEGIN(print_format, ":") {
|
||||||
config.print_format = optarg;
|
config.print_format = optarg;
|
||||||
} OPT_END(print_format);
|
} OPT_END(print_format);
|
||||||
|
|
||||||
|
OPT_BEGIN(write_hdr_format, ":") {
|
||||||
|
config.write_hdr_format = optarg;
|
||||||
|
} OPT_END(write_hdr_format);
|
||||||
|
|
||||||
|
OPT_BEGIN(write_xact_format, ":") {
|
||||||
|
config.write_xact_format = optarg;
|
||||||
|
} OPT_END(write_xact_format);
|
||||||
|
|
||||||
OPT_BEGIN(equity_format, ":") {
|
OPT_BEGIN(equity_format, ":") {
|
||||||
config.equity_format = optarg;
|
config.equity_format = optarg;
|
||||||
} OPT_END(equity_format);
|
} OPT_END(equity_format);
|
||||||
|
|
@ -967,6 +977,8 @@ void export_config()
|
||||||
.def_readwrite("plot_amount_format", &config_t::plot_amount_format)
|
.def_readwrite("plot_amount_format", &config_t::plot_amount_format)
|
||||||
.def_readwrite("plot_total_format", &config_t::plot_total_format)
|
.def_readwrite("plot_total_format", &config_t::plot_total_format)
|
||||||
.def_readwrite("print_format", &config_t::print_format)
|
.def_readwrite("print_format", &config_t::print_format)
|
||||||
|
.def_readwrite("write_hdr_format", &config_t::write_hdr_format)
|
||||||
|
.def_readwrite("write_xact_format", &config_t::write_xact_format)
|
||||||
.def_readwrite("equity_format", &config_t::equity_format)
|
.def_readwrite("equity_format", &config_t::equity_format)
|
||||||
.def_readwrite("prices_format", &config_t::prices_format)
|
.def_readwrite("prices_format", &config_t::prices_format)
|
||||||
.def_readwrite("date_format", &config_t::date_format)
|
.def_readwrite("date_format", &config_t::date_format)
|
||||||
|
|
|
||||||
2
config.h
2
config.h
|
|
@ -36,6 +36,8 @@ struct config_t
|
||||||
std::string plot_amount_format;
|
std::string plot_amount_format;
|
||||||
std::string plot_total_format;
|
std::string plot_total_format;
|
||||||
std::string print_format;
|
std::string print_format;
|
||||||
|
std::string write_hdr_format;
|
||||||
|
std::string write_xact_format;
|
||||||
std::string equity_format;
|
std::string equity_format;
|
||||||
std::string prices_format;
|
std::string prices_format;
|
||||||
std::string date_format;
|
std::string date_format;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue