summaryrefslogtreecommitdiffstats
path: root/main.cc
diff options
context:
space:
mode:
authorDaniel Baumann <mail@daniel-baumann.ch>2015-11-08 04:25:30 +0000
committerDaniel Baumann <mail@daniel-baumann.ch>2015-11-08 04:25:30 +0000
commit26f1d5c221a20e4c9858e6ab2ac0c2fed8fdbdd4 (patch)
tree56d8448080a67622474e76f86071049a7c7d1ae9 /main.cc
parentAdding debian version 1.0~rc6-1. (diff)
downloadzutils-26f1d5c221a20e4c9858e6ab2ac0c2fed8fdbdd4.tar.xz
zutils-26f1d5c221a20e4c9858e6ab2ac0c2fed8fdbdd4.zip
Merging upstream version 1.0~rc7.
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
Diffstat (limited to '')
-rw-r--r--main.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/main.cc b/main.cc
index 0440f77..f0a66e1 100644
--- a/main.cc
+++ b/main.cc
@@ -251,7 +251,7 @@ int main( const int argc, const char * const argv[] )
int argind = 0;
int grep_show_name = -1;
- bool grep_list = false;
+ int grep_list_mode = 0; // 1 = list matches, -1 = list non matches
bool grep_pattern_found = false;
for( ; argind < parser.arguments(); ++argind )
{
@@ -317,8 +317,8 @@ int main( const int argc, const char * const argv[] )
case 'H': grep_show_name = true; break;
case 'i': grep_args.push_back( "-i" ); break;
case 'I': grep_args.push_back( "-I" ); break;
- case 'l': grep_args.push_back( "-l" ); grep_list = true; break;
- case 'L': grep_args.push_back( "-L" ); grep_list = true; break;
+ case 'l': grep_args.push_back( "-l" ); grep_list_mode = 1; break;
+ case 'L': grep_args.push_back( "-L" ); grep_list_mode = -1; break;
case 'm': grep_args.push_back( "-m" ); grep_args.push_back( arg ); break;
case 'n': grep_args.push_back( "-n" ); break;
case 'o': grep_args.push_back( "-o" ); break;
@@ -412,7 +412,7 @@ int main( const int argc, const char * const argv[] )
if( infd == STDIN_FILENO )
tmp = zgrep_stdin( infd, format_type, grep_args );
else tmp = zgrep_file( infd, format_type, input_filename, grep_args,
- grep_list, grep_show_name );
+ grep_list_mode, grep_show_name );
break;
case m_ztest:
if( infd == STDIN_FILENO )