Skip to content

Commit 73b4354

Browse files
authored
Merge pull request #119 from CESNET/fdsdump-filter-stdin
fdsdump: allow loading filter from stdin instead of command line
2 parents 80c389b + 1f53cea commit 73b4354

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/tools/fdsdump/src/options.cpp

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#include <iostream>
1212

1313
#include <getopt.h>
14+
#include <string>
1415
#include <unistd.h>
1516

1617
#include <common/common.hpp>
@@ -133,7 +134,15 @@ void Options::parse(int argc, char *argv[])
133134
}
134135

135136
if (args.has('F')) {
136-
m_input_filter = args.get('F');
137+
if (args.get('F') == "-") {
138+
std::string line;
139+
while (std::getline(std::cin, line)) {
140+
m_input_filter.append(line);
141+
m_input_filter.append("\n");
142+
}
143+
} else {
144+
m_input_filter = args.get('F');
145+
}
137146
}
138147

139148
if (args.has('A')) {

0 commit comments

Comments
 (0)