File tree Expand file tree Collapse file tree 3 files changed +15
-0
lines changed
Expand file tree Collapse file tree 3 files changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -40,6 +40,13 @@ TagsTable::Builder& TagsTable::Builder::withTagDescriptions (std::vector <TagDes
4040 return *this ;
4141}
4242
43+ // //////////////////////////////////////////////////////////////////////////////
44+ TagsTable::Builder& TagsTable::Builder::withColor (bool forceColor)
45+ {
46+ _force_color = forceColor;
47+ return *this ;
48+ }
49+
4350// //////////////////////////////////////////////////////////////////////////////
4451Table TagsTable::Builder::build ()
4552{
@@ -51,6 +58,11 @@ Table TagsTable::Builder::build ()
5158 table.add (" Tag" );
5259 table.add (" Description" );
5360
61+ if (_force_color)
62+ {
63+ table.forceColor ();
64+ }
65+
5466 for (const auto & tagDescription : _tagDescriptions)
5567 {
5668 auto row = table.addRow ();
Original file line number Diff line number Diff line change @@ -37,11 +37,13 @@ class TagsTable
3737 {
3838 public:
3939 Builder& withTagDescriptions (std::vector <TagDescription>&);
40+ Builder& withColor (bool );
4041
4142 Table build ();
4243
4344 private:
4445 std::vector <TagDescription> _tagDescriptions {};
46+ bool _force_color {false };
4547 };
4648
4749public:
Original file line number Diff line number Diff line change @@ -80,6 +80,7 @@ int CmdTags (
8080
8181 auto table = TagsTable::builder ()
8282 .withTagDescriptions (tagDescriptions)
83+ .withColor (rules.getBoolean (" color" ))
8384 .build ();
8485
8586 std::cout << ' \n '
You can’t perform that action at this time.
0 commit comments