Commit 6ce12cfc authored by Aaron's avatar Aaron
Browse files

groupby now supports - for stdin

parent 0fd0d47b
......@@ -87,12 +87,7 @@ int groupby_main(int argc, char* argv[]) {
int parameterLength = (int)strlen(argv[i]);
if(PARAMETER_CHECK("-i", 2, parameterLength)) {
if ((i+1) >= argc || LOOKS_LIKE_A_PARAM(argv[i+1])) {
cerr << endl << "*****ERROR: -i parameter requires a value." << endl << endl;
groupby_help();
break;
}
else {
if ((i+1) < argc) {
inFile = argv[i + 1];
i++;
}
......
......@@ -27,7 +27,7 @@ TabFile::~TabFile(void) {
void TabFile::Open(void) {
if (_tabFile == "stdin") {
if (_tabFile == "stdin" || _tabFile == "-") {
_tabStream = &cin;
}
else {
......@@ -71,7 +71,7 @@ void TabFile::Open(void) {
// Close the TAB file
void TabFile::Close(void) {
if (_tabFile != "stdin") delete _tabStream;
if (_tabFile != "stdin" && _tabFile != "-") delete _tabStream;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment