Skip to content

Commit c04fd99

Browse files
committed
csgrep --mode=evtstat: print the 3rd column aligned, too
1 parent 6d89449 commit c04fd99

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/csgrep.cc

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -123,16 +123,20 @@ class EvtCounter: public StatWriter {
123123
virtual void flush() {
124124
for (TMap::const_reference item : cnt_) {
125125
using namespace std;
126+
const TKey &key = item.first;
127+
128+
// save iostream flags
126129
const ios_base::fmtflags oldFlags = cout.flags();
127130
const int oldWidth = cout.width();
131+
128132
cout << fixed << setw(7) << item.second;
133+
cout << "\t" << left << setw(32) << key.first;
134+
135+
// restore iostream flags
129136
cout.width(oldWidth);
130137
cout.flags(oldFlags);
131138

132-
const TKey &key = item.first;
133-
cout << "\t" << key.first
134-
<< "\t" << key.second
135-
<< "\n";
139+
cout << "\t" << key.second << "\n";
136140
}
137141
}
138142
};

0 commit comments

Comments
 (0)