From d9d02d7137b23952e963c0b5b8e8c1539391bcc7 Mon Sep 17 00:00:00 2001 From: Ole Tange Date: Sat, 17 Dec 2022 22:36:15 +0100 Subject: [PATCH] G: added --i --- G/G | 23 +++++++++++++++++++++++ teetime/teetime | 2 +- vid/vid | 1 + 3 files changed, 25 insertions(+), 1 deletion(-) diff --git a/G/G b/G/G index 5125fba..9d0562d 100755 --- a/G/G +++ b/G/G @@ -34,6 +34,11 @@ necessarily on the same line. If a parent dir contains a B<.git> dir B is used. +=item B<--i> + +Ignore case for all following options. + + =item I All B options. @@ -48,6 +53,11 @@ Grep for lines with Foo but not Bar: G Foo -v Bar +Grep for lines with Foo, bar but not baz. Ignore case for bar and baz: + + G Foo --i bar -v baz + + =head1 AUTHOR Copyright (C) 2017-2018 Ole Tange, @@ -85,6 +95,7 @@ B =cut my $i = 0; +my $add_i = ""; for(@ARGV) { if($_ eq "-g") { @@ -93,9 +104,21 @@ for(@ARGV) { # -g not an option for grep next; } + if($_ eq "--i") { + # --i = add ignore case to the rest + $opt::i ||= 1; + $add_i = "-i"; + # --i not an option for grep + next; + } + if($add_i) { push @{$cmd[$i]}, $add_i; $add_i = ""; } push @{$cmd[$i]}, $_; if(/^[^-]/) { $i++; + if($opt::i) { + # If --i: add -i as option + $add_i = "-i"; + } } } diff --git a/teetime/teetime b/teetime/teetime index 432891e..331f441 100755 --- a/teetime/teetime +++ b/teetime/teetime @@ -186,7 +186,7 @@ sub version() { print join ("\n", "GNU $Global::progname $Global::version", - "Copyright (C) 2020 Ole Tange, http://ole.tange.dk and Free Software", + "Copyright (C) 2020-2022 Ole Tange, http://ole.tange.dk and Free Software", "Foundation, Inc.", "License GPLv3+: GNU GPL version 3 or later ", "This is free software: you are free to change and redistribute it.", diff --git a/vid/vid b/vid/vid index 07169fc..2045475 100755 --- a/vid/vid +++ b/vid/vid @@ -67,6 +67,7 @@ B =cut +ulimit -u `ulimit -Hu` find_find_vidlist() { # find_find_vidlist(start_dir) # Find the file .vidlist in . .. ../.. ../../.. etc