diff options
author | John Wiegley <johnw@newartisans.com> | 2016-10-27 13:10:35 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-10-27 13:10:35 -0700 |
commit | f0e6140c8bc7565d0abe907dc7e08b7055b4a93b (patch) | |
tree | 8cf7ab81456fa989f2883d8106a9a9086354064e | |
parent | 310370db041349c94e6984cc283be18f5a25a6ca (diff) | |
parent | 5b70d4e5e4ec55ac977be4264f75cb5c3b764327 (diff) | |
download | fork-ledger-f0e6140c8bc7565d0abe907dc7e08b7055b4a93b.tar.gz fork-ledger-f0e6140c8bc7565d0abe907dc7e08b7055b4a93b.tar.bz2 fork-ledger-f0e6140c8bc7565d0abe907dc7e08b7055b4a93b.zip |
Merge pull request #395 from thdox/force-color
--force-color does not require anymore --color.
-rw-r--r-- | src/report.cc | 3 | ||||
-rwxr-xr-x | test/CheckBaselineTests.py | 1 | ||||
-rw-r--r-- | test/baseline/opt-color.test | 8 | ||||
-rw-r--r-- | test/baseline/opt-force-color.test | 19 | ||||
-rw-r--r-- | test/regress/727B2DF8.test | 2 |
5 files changed, 27 insertions, 6 deletions
diff --git a/src/report.cc b/src/report.cc index 78ccac51..b2162034 100644 --- a/src/report.cc +++ b/src/report.cc @@ -64,6 +64,9 @@ void report_t::normalize_options(const string& verb) if (HANDLED(color) && ! isatty(STDOUT_FILENO)) HANDLER(color).off(); } + else { + HANDLER(color).on("?normalize"); + } if (! HANDLED(force_pager)) { if (HANDLED(pager_) && ! isatty(STDOUT_FILENO)) HANDLER(pager_).off(); diff --git a/test/CheckBaselineTests.py b/test/CheckBaselineTests.py index 8659d1b5..f53c59a2 100755 --- a/test/CheckBaselineTests.py +++ b/test/CheckBaselineTests.py @@ -23,7 +23,6 @@ class CheckBaselineTests (CheckOptions): 'args-only', 'debug', 'download', - 'force-color', 'force-pager', 'generated', 'help', diff --git a/test/baseline/opt-color.test b/test/baseline/opt-color.test index a7d702bd..a0abdffc 100644 --- a/test/baseline/opt-color.test +++ b/test/baseline/opt-color.test @@ -2,10 +2,10 @@ Assets:Investments:Vanguard:VMMXX 0.350 VMMXX @ $1.00 Income:Dividends:Vanguard:VMMXX $-0.35 -test bal --color --force-color - 0.350 VMMXX [34mAssets:Investments:Vanguard:VMMXX[0m - [31m$-0.35[0m [34mIncome:Dividends:Vanguard:VMMXX[0m +test bal --color + 0.350 VMMXX Assets:Investments:Vanguard:VMMXX + $-0.35 Income:Dividends:Vanguard:VMMXX -------------------- - [31m$-0.35[0m + $-0.35 0.350 VMMXX end test diff --git a/test/baseline/opt-force-color.test b/test/baseline/opt-force-color.test new file mode 100644 index 00000000..536c3834 --- /dev/null +++ b/test/baseline/opt-force-color.test @@ -0,0 +1,19 @@ +2007/02/02 RD VMMXX + Assets:Investments:Vanguard:VMMXX 0.350 VMMXX @ $1.00 + Income:Dividends:Vanguard:VMMXX $-0.35 + +test bal --force-color + 0.350 VMMXX [34mAssets:Investments:Vanguard:VMMXX[0m + [31m$-0.35[0m [34mIncome:Dividends:Vanguard:VMMXX[0m +-------------------- + [31m$-0.35[0m + 0.350 VMMXX +end test + +test bal + 0.350 VMMXX Assets:Investments:Vanguard:VMMXX + $-0.35 Income:Dividends:Vanguard:VMMXX +-------------------- + $-0.35 + 0.350 VMMXX +end test diff --git a/test/regress/727B2DF8.test b/test/regress/727B2DF8.test index 0c32d660..ad2b903f 100644 --- a/test/regress/727B2DF8.test +++ b/test/regress/727B2DF8.test @@ -43,7 +43,7 @@ N $ Assets:Bank:Checking ; :AnotherTag: -test reg --color --force-color +test reg --force-color 04-May-01 Checking balance [34mAssets:Bank:Checking [0m $1,000.00 $1,000.00 [34mEquit:Opening Balances[0m [31m$-1,000.00[0m 0 04-May-03 Investment balance [34mAssets:Brokerage [0m 50 AAPL 50 AAPL |